diff options
Diffstat (limited to 'spec/frontend/admin/users')
7 files changed, 20 insertions, 20 deletions
diff --git a/spec/frontend/admin/users/components/actions/actions_spec.js b/spec/frontend/admin/users/components/actions/actions_spec.js index b758c15a91a..4967753b91c 100644 --- a/spec/frontend/admin/users/components/actions/actions_spec.js +++ b/spec/frontend/admin/users/components/actions/actions_spec.js @@ -12,7 +12,7 @@ import { paths } from '../../mock_data'; describe('Action components', () => { let wrapper; - const findDropdownItem = () => wrapper.find(GlDropdownItem); + const findDropdownItem = () => wrapper.findComponent(GlDropdownItem); const initComponent = ({ component, props } = {}) => { wrapper = shallowMount(component, { diff --git a/spec/frontend/admin/users/components/app_spec.js b/spec/frontend/admin/users/components/app_spec.js index 65b13e3a40d..913732aae42 100644 --- a/spec/frontend/admin/users/components/app_spec.js +++ b/spec/frontend/admin/users/components/app_spec.js @@ -28,7 +28,7 @@ describe('AdminUsersApp component', () => { }); it('renders the admin users table with props', () => { - expect(wrapper.find(AdminUsersTable).props()).toEqual({ + expect(wrapper.findComponent(AdminUsersTable).props()).toEqual({ users, paths, }); diff --git a/spec/frontend/admin/users/components/modals/delete_user_modal_spec.js b/spec/frontend/admin/users/components/modals/delete_user_modal_spec.js index 09a345ac826..70ed9eeb3e1 100644 --- a/spec/frontend/admin/users/components/modals/delete_user_modal_spec.js +++ b/spec/frontend/admin/users/components/modals/delete_user_modal_spec.js @@ -17,7 +17,7 @@ describe('Delete user modal', () => { const findButton = (variant, category) => wrapper - .findAll(GlButton) + .findAllComponents(GlButton) .filter((w) => w.attributes('variant') === variant && w.attributes('category') === category) .at(0); const findForm = () => wrapper.find('form'); @@ -87,8 +87,8 @@ describe('Delete user modal', () => { }); it('has disabled buttons', () => { - expect(findPrimaryButton().attributes('disabled')).toBeTruthy(); - expect(findSecondaryButton().attributes('disabled')).toBeTruthy(); + expect(findPrimaryButton().attributes('disabled')).toBe('true'); + expect(findSecondaryButton().attributes('disabled')).toBe('true'); }); }); @@ -105,8 +105,8 @@ describe('Delete user modal', () => { }); it('has disabled buttons', () => { - expect(findPrimaryButton().attributes('disabled')).toBeTruthy(); - expect(findSecondaryButton().attributes('disabled')).toBeTruthy(); + expect(findPrimaryButton().attributes('disabled')).toBe('true'); + expect(findSecondaryButton().attributes('disabled')).toBe('true'); }); }); @@ -123,8 +123,8 @@ describe('Delete user modal', () => { }); it('has enabled buttons', () => { - expect(findPrimaryButton().attributes('disabled')).toBeFalsy(); - expect(findSecondaryButton().attributes('disabled')).toBeFalsy(); + expect(findPrimaryButton().attributes('disabled')).toBeUndefined(); + expect(findSecondaryButton().attributes('disabled')).toBeUndefined(); }); describe('when primary action is clicked', () => { diff --git a/spec/frontend/admin/users/components/user_actions_spec.js b/spec/frontend/admin/users/components/user_actions_spec.js index e04c43ae3f2..ffc05e744c8 100644 --- a/spec/frontend/admin/users/components/user_actions_spec.js +++ b/spec/frontend/admin/users/components/user_actions_spec.js @@ -83,7 +83,7 @@ describe('AdminUserActions component', () => { }); it.each(CONFIRMATION_ACTIONS)('renders an action component item for "%s"', (action) => { - const component = wrapper.find(Actions[capitalizeFirstCharacter(action)]); + const component = wrapper.findComponent(Actions[capitalizeFirstCharacter(action)]); expect(component.props('username')).toBe(user.name); expect(component.props('path')).toBe(userPaths[action]); @@ -119,7 +119,7 @@ describe('AdminUserActions component', () => { }); it.each(DELETE_ACTIONS)('renders a delete action component item for "%s"', (action) => { - const component = wrapper.find(Actions[capitalizeFirstCharacter(action)]); + const component = wrapper.findComponent(Actions[capitalizeFirstCharacter(action)]); expect(component.props('username')).toBe(user.name); expect(component.props('paths')).toEqual(userPaths); diff --git a/spec/frontend/admin/users/components/user_avatar_spec.js b/spec/frontend/admin/users/components/user_avatar_spec.js index 8bbfb89bec1..94fac875fbe 100644 --- a/spec/frontend/admin/users/components/user_avatar_spec.js +++ b/spec/frontend/admin/users/components/user_avatar_spec.js @@ -12,10 +12,10 @@ describe('AdminUserAvatar component', () => { const user = users[0]; const adminUserPath = paths.adminUser; - const findNote = () => wrapper.find(GlIcon); - const findAvatar = () => wrapper.find(GlAvatarLabeled); + const findNote = () => wrapper.findComponent(GlIcon); + const findAvatar = () => wrapper.findComponent(GlAvatarLabeled); const findUserLink = () => wrapper.find('.js-user-link'); - const findAllBadges = () => wrapper.findAll(GlBadge); + const findAllBadges = () => wrapper.findAllComponents(GlBadge); const findTooltip = () => getBinding(findNote().element, 'gl-tooltip'); const initComponent = (props = {}) => { diff --git a/spec/frontend/admin/users/components/users_table_spec.js b/spec/frontend/admin/users/components/users_table_spec.js index ad1c45495b5..fe07f0fce00 100644 --- a/spec/frontend/admin/users/components/users_table_spec.js +++ b/spec/frontend/admin/users/components/users_table_spec.js @@ -30,10 +30,10 @@ describe('AdminUsersTable component', () => { const fetchGroupCountsResponse = createFetchGroupCount([{ id: user.id, groupCount: 5 }]); const findUserGroupCount = (id) => wrapper.findByTestId(`user-group-count-${id}`); - const findUserGroupCountLoader = (id) => findUserGroupCount(id).find(GlSkeletonLoader); + const findUserGroupCountLoader = (id) => findUserGroupCount(id).findComponent(GlSkeletonLoader); const getCellByLabel = (trIdx, label) => { return wrapper - .find(GlTable) + .findComponent(GlTable) .find('tbody') .findAll('tr') .at(trIdx) @@ -72,7 +72,7 @@ describe('AdminUsersTable component', () => { }); it('renders the user actions', () => { - expect(wrapper.find(AdminUserActions).exists()).toBe(true); + expect(wrapper.findComponent(AdminUserActions).exists()).toBe(true); }); it.each` @@ -81,7 +81,7 @@ describe('AdminUsersTable component', () => { ${AdminUserDate} | ${'Created on'} ${AdminUserDate} | ${'Last activity'} `('renders the component for column $label', ({ component, label }) => { - expect(getCellByLabel(0, label).find(component).exists()).toBe(true); + expect(getCellByLabel(0, label).findComponent(component).exists()).toBe(true); }); }); diff --git a/spec/frontend/admin/users/index_spec.js b/spec/frontend/admin/users/index_spec.js index 961fa96acdd..b51858d5129 100644 --- a/spec/frontend/admin/users/index_spec.js +++ b/spec/frontend/admin/users/index_spec.js @@ -8,7 +8,7 @@ describe('initAdminUsersApp', () => { let wrapper; let el; - const findApp = () => wrapper.find(AdminUsersApp); + const findApp = () => wrapper.findComponent(AdminUsersApp); beforeEach(() => { el = document.createElement('div'); @@ -36,7 +36,7 @@ describe('initAdminUserActions', () => { let wrapper; let el; - const findUserActions = () => wrapper.find(UserActions); + const findUserActions = () => wrapper.findComponent(UserActions); beforeEach(() => { el = document.createElement('div'); |