diff options
Diffstat (limited to 'spec/frontend/members/components/table')
7 files changed, 20 insertions, 14 deletions
diff --git a/spec/frontend/members/components/table/created_at_spec.js b/spec/frontend/members/components/table/created_at_spec.js index 74b71e22893..793c122587d 100644 --- a/spec/frontend/members/components/table/created_at_spec.js +++ b/spec/frontend/members/components/table/created_at_spec.js @@ -39,7 +39,7 @@ describe('CreatedAt', () => { }); it('uses `TimeAgoTooltip` component to display tooltip', () => { - expect(wrapper.find(TimeAgoTooltip).exists()).toBe(true); + expect(wrapper.findComponent(TimeAgoTooltip).exists()).toBe(true); }); }); diff --git a/spec/frontend/members/components/table/expiration_datepicker_spec.js b/spec/frontend/members/components/table/expiration_datepicker_spec.js index 4fb43fbd888..9b8f053348b 100644 --- a/spec/frontend/members/components/table/expiration_datepicker_spec.js +++ b/spec/frontend/members/components/table/expiration_datepicker_spec.js @@ -56,7 +56,7 @@ describe('ExpirationDatepicker', () => { }; const findInput = () => wrapper.find('input'); - const findDatepicker = () => wrapper.find(GlDatepicker); + const findDatepicker = () => wrapper.findComponent(GlDatepicker); afterEach(() => { wrapper.destroy(); diff --git a/spec/frontend/members/components/table/member_action_buttons_spec.js b/spec/frontend/members/components/table/member_action_buttons_spec.js index 1379b2d26ce..f3f50bf620a 100644 --- a/spec/frontend/members/components/table/member_action_buttons_spec.js +++ b/spec/frontend/members/components/table/member_action_buttons_spec.js @@ -38,7 +38,7 @@ describe('MemberActionButtons', () => { ({ memberType, member, expectedComponent }) => { createComponent({ memberType, member }); - expect(wrapper.find(expectedComponent).exists()).toBe(true); + expect(wrapper.findComponent(expectedComponent).exists()).toBe(true); }, ); }); diff --git a/spec/frontend/members/components/table/member_avatar_spec.js b/spec/frontend/members/components/table/member_avatar_spec.js index 3cce64effbc..35f82c28fc5 100644 --- a/spec/frontend/members/components/table/member_avatar_spec.js +++ b/spec/frontend/members/components/table/member_avatar_spec.js @@ -33,7 +33,7 @@ describe('MemberList', () => { ({ memberType, member, expectedComponent }) => { createComponent({ memberType, member }); - expect(wrapper.find(expectedComponent).exists()).toBe(true); + expect(wrapper.findComponent(expectedComponent).exists()).toBe(true); }, ); }); diff --git a/spec/frontend/members/components/table/members_table_cell_spec.js b/spec/frontend/members/components/table/members_table_cell_spec.js index 6575a7c7126..fd56699602e 100644 --- a/spec/frontend/members/components/table/members_table_cell_spec.js +++ b/spec/frontend/members/components/table/members_table_cell_spec.js @@ -69,7 +69,7 @@ describe('MembersTableCell', () => { }); }; - const findWrappedComponent = () => wrapper.find(WrappedComponent); + const findWrappedComponent = () => wrapper.findComponent(WrappedComponent); const memberCurrentUser = { ...memberMock, diff --git a/spec/frontend/members/components/table/members_table_spec.js b/spec/frontend/members/components/table/members_table_spec.js index 08baa663bf0..0ed01396fcb 100644 --- a/spec/frontend/members/components/table/members_table_spec.js +++ b/spec/frontend/members/components/table/members_table_spec.js @@ -81,13 +81,13 @@ describe('MembersTable', () => { const url = 'https://localhost/foo-bar/-/project_members?tab=invited'; - const findTable = () => wrapper.find(GlTable); + const findTable = () => wrapper.findComponent(GlTable); const findTableCellByMemberId = (tableCellLabel, memberId) => wrapper .findByTestId(`members-table-row-${memberId}`) .find(`[data-label="${tableCellLabel}"][role="cell"]`); - const findPagination = () => extendedWrapper(wrapper.find(GlPagination)); + const findPagination = () => extendedWrapper(wrapper.findComponent(GlPagination)); const expectCorrectLinkToPage2 = () => { expect(findPagination().findByText('2', { selector: 'a' }).attributes('href')).toBe( @@ -126,7 +126,10 @@ describe('MembersTable', () => { if (expectedComponent) { expect( - wrapper.find(`[data-label="${label}"][role="cell"]`).find(expectedComponent).exists(), + wrapper + .find(`[data-label="${label}"][role="cell"]`) + .findComponent(expectedComponent) + .exists(), ).toBe(true); } }); @@ -179,7 +182,10 @@ describe('MembersTable', () => { expect(actionField.exists()).toBe(true); expect(actionField.classes('gl-sr-only')).toBe(true); expect( - wrapper.find(`[data-label="Actions"][role="cell"]`).find(MemberActionButtons).exists(), + wrapper + .find(`[data-label="Actions"][role="cell"]`) + .findComponent(MemberActionButtons) + .exists(), ).toBe(true); }); @@ -250,9 +256,9 @@ describe('MembersTable', () => { it('renders badge in "Max role" field', () => { createComponent({ members: [memberMock], tableFields: ['maxRole'] }); - expect(wrapper.find(`[data-label="Max role"][role="cell"]`).find(GlBadge).text()).toBe( - memberMock.accessLevel.stringValue, - ); + expect( + wrapper.find(`[data-label="Max role"][role="cell"]`).findComponent(GlBadge).text(), + ).toBe(memberMock.accessLevel.stringValue); }); }); diff --git a/spec/frontend/members/components/table/role_dropdown_spec.js b/spec/frontend/members/components/table/role_dropdown_spec.js index 2f1626a7044..b254cce4d72 100644 --- a/spec/frontend/members/components/table/role_dropdown_spec.js +++ b/spec/frontend/members/components/table/role_dropdown_spec.js @@ -57,11 +57,11 @@ describe('RoleDropdown', () => { ); const getCheckedDropdownItem = () => wrapper - .findAll(GlDropdownItem) + .findAllComponents(GlDropdownItem) .wrappers.find((dropdownItemWrapper) => dropdownItemWrapper.props('isChecked')); const findDropdownToggle = () => wrapper.find('button[aria-haspopup="true"]'); - const findDropdown = () => wrapper.find(GlDropdown); + const findDropdown = () => wrapper.findComponent(GlDropdown); afterEach(() => { wrapper.destroy(); |