diff options
Diffstat (limited to 'spec/frontend/feature_flags/components')
14 files changed, 81 insertions, 81 deletions
diff --git a/spec/frontend/feature_flags/components/configure_feature_flags_modal_spec.js b/spec/frontend/feature_flags/components/configure_feature_flags_modal_spec.js index 4a0242b4a46..c1051a14a08 100644 --- a/spec/frontend/feature_flags/components/configure_feature_flags_modal_spec.js +++ b/spec/frontend/feature_flags/components/configure_feature_flags_modal_spec.js @@ -39,7 +39,7 @@ describe('Configure Feature Flags Modal', () => { const findSecondaryAction = () => findGlModal().props('actionSecondary'); const findProjectNameInput = () => wrapper.find('#project_name_verification'); const findDangerGlAlert = () => - wrapper.findAll(GlAlert).filter((c) => c.props('variant') === 'danger'); + wrapper.findAllComponents(GlAlert).filter((c) => c.props('variant') === 'danger'); describe('idle', () => { afterEach(() => wrapper.destroy()); @@ -157,7 +157,7 @@ describe('Configure Feature Flags Modal', () => { beforeEach(factory.bind(null, { isRotating: true })); it('should disable the project name input', async () => { - expect(findProjectNameInput().attributes('disabled')).toBeTruthy(); + expect(findProjectNameInput().attributes('disabled')).toBe('true'); }); }); }); diff --git a/spec/frontend/feature_flags/components/empty_state_spec.js b/spec/frontend/feature_flags/components/empty_state_spec.js index 4ac82ae44a6..e3cc6f703c4 100644 --- a/spec/frontend/feature_flags/components/empty_state_spec.js +++ b/spec/frontend/feature_flags/components/empty_state_spec.js @@ -57,7 +57,7 @@ describe('feature_flags/components/feature_flags_tab.vue', () => { beforeEach(() => { wrapper = factory(); - alerts = wrapper.findAll(GlAlert); + alerts = wrapper.findAllComponents(GlAlert); }); it('should show any alerts', () => { @@ -68,7 +68,7 @@ describe('feature_flags/components/feature_flags_tab.vue', () => { it('should emit a dismiss event for a dismissed alert', () => { alerts.at(0).vm.$emit('dismiss'); - expect(wrapper.find(EmptyState).emitted('dismissAlert')).toEqual([[0]]); + expect(wrapper.findComponent(EmptyState).emitted('dismissAlert')).toEqual([[0]]); }); }); @@ -78,8 +78,8 @@ describe('feature_flags/components/feature_flags_tab.vue', () => { }); it('should show a loading icon and nothing else', () => { - expect(wrapper.find(GlLoadingIcon).exists()).toBe(true); - expect(wrapper.findAll(GlEmptyState)).toHaveLength(0); + expect(wrapper.findComponent(GlLoadingIcon).exists()).toBe(true); + expect(wrapper.findAllComponents(GlEmptyState)).toHaveLength(0); }); }); @@ -88,7 +88,7 @@ describe('feature_flags/components/feature_flags_tab.vue', () => { beforeEach(() => { wrapper = factory({ errorState: true }); - emptyState = wrapper.find(GlEmptyState); + emptyState = wrapper.findComponent(GlEmptyState); }); it('should show an error state if there has been an error', () => { @@ -106,8 +106,8 @@ describe('feature_flags/components/feature_flags_tab.vue', () => { beforeEach(() => { wrapper = factory({ emptyState: true }); - emptyState = wrapper.find(GlEmptyState); - emptyStateLink = emptyState.find(GlLink); + emptyState = wrapper.findComponent(GlEmptyState); + emptyStateLink = emptyState.findComponent(GlLink); }); it('should show an empty state if it is empty', () => { diff --git a/spec/frontend/feature_flags/components/environments_dropdown_spec.js b/spec/frontend/feature_flags/components/environments_dropdown_spec.js index cca472012e9..e8103df78bc 100644 --- a/spec/frontend/feature_flags/components/environments_dropdown_spec.js +++ b/spec/frontend/feature_flags/components/environments_dropdown_spec.js @@ -23,7 +23,7 @@ describe('Feature flags > Environments dropdown ', () => { }); }; - const findEnvironmentSearchInput = () => wrapper.find(GlSearchBoxByType); + const findEnvironmentSearchInput = () => wrapper.findComponent(GlSearchBoxByType); const findDropdownMenu = () => wrapper.find('.dropdown-menu'); afterEach(() => { @@ -91,7 +91,7 @@ describe('Feature flags > Environments dropdown ', () => { describe('with received data', () => { it('sets is loading to false', () => { expect(wrapper.vm.isLoading).toBe(false); - expect(wrapper.find(GlLoadingIcon).exists()).toBe(false); + expect(wrapper.findComponent(GlLoadingIcon).exists()).toBe(false); }); it('shows the suggestions', () => { @@ -100,7 +100,7 @@ describe('Feature flags > Environments dropdown ', () => { it('emits event when a suggestion is clicked', async () => { const button = wrapper - .findAll(GlButton) + .findAllComponents(GlButton) .filter((b) => b.text() === 'production') .at(0); button.vm.$emit('click'); @@ -111,7 +111,7 @@ describe('Feature flags > Environments dropdown ', () => { describe('on click clear button', () => { beforeEach(async () => { - wrapper.find(GlButton).vm.$emit('click'); + wrapper.findComponent(GlButton).vm.$emit('click'); await nextTick(); }); @@ -137,7 +137,7 @@ describe('Feature flags > Environments dropdown ', () => { }); it('emits create event', async () => { - wrapper.findAll(GlButton).at(0).vm.$emit('click'); + wrapper.findAllComponents(GlButton).at(0).vm.$emit('click'); await nextTick(); expect(wrapper.emitted('createClicked')).toEqual([['production']]); }); diff --git a/spec/frontend/feature_flags/components/feature_flags_table_spec.js b/spec/frontend/feature_flags/components/feature_flags_table_spec.js index 99864a95f59..47f12f70056 100644 --- a/spec/frontend/feature_flags/components/feature_flags_table_spec.js +++ b/spec/frontend/feature_flags/components/feature_flags_table_spec.js @@ -119,7 +119,7 @@ describe('Feature flag table', () => { it('should render an environments specs badge with active class', () => { const envColumn = wrapper.find('.js-feature-flag-environments'); - expect(trimText(envColumn.find(GlBadge).text())).toBe('All Users: All Environments'); + expect(trimText(envColumn.findComponent(GlBadge).text())).toBe('All Users: All Environments'); }); it('should render an actions column', () => { @@ -137,7 +137,7 @@ describe('Feature flag table', () => { beforeEach(() => { props.featureFlags[0].update_path = props.featureFlags[0].destroy_path; createWrapper(props); - toggle = wrapper.find(GlToggle); + toggle = wrapper.findComponent(GlToggle); spy = mockTracking('_category_', toggle.element, jest.spyOn); }); diff --git a/spec/frontend/feature_flags/components/form_spec.js b/spec/frontend/feature_flags/components/form_spec.js index 3ad1225906b..7dd7c709c94 100644 --- a/spec/frontend/feature_flags/components/form_spec.js +++ b/spec/frontend/feature_flags/components/form_spec.js @@ -61,7 +61,7 @@ describe('feature flag form', () => { it('does not render the related issues widget without the featureFlagIssuesEndpoint', () => { factory(requiredProps); - expect(wrapper.find(RelatedIssuesRoot).exists()).toBe(false); + expect(wrapper.findComponent(RelatedIssuesRoot).exists()).toBe(false); }); it('renders the related issues widget when the featureFlagIssuesEndpoint is provided', () => { @@ -73,7 +73,7 @@ describe('feature flag form', () => { }, ); - expect(wrapper.find(RelatedIssuesRoot).exists()).toBe(true); + expect(wrapper.findComponent(RelatedIssuesRoot).exists()).toBe(true); }); describe('without provided data', () => { @@ -114,7 +114,7 @@ describe('feature flag form', () => { }); it('should show the strategy component', () => { - const strategy = wrapper.find(Strategy); + const strategy = wrapper.findComponent(Strategy); expect(strategy.exists()).toBe(true); expect(strategy.props('strategy')).toEqual({ type: ROLLOUT_STRATEGY_PERCENT_ROLLOUT, @@ -124,14 +124,14 @@ describe('feature flag form', () => { }); it('should show one strategy component per strategy', () => { - expect(wrapper.findAll(Strategy)).toHaveLength(2); + expect(wrapper.findAllComponents(Strategy)).toHaveLength(2); }); it('adds an all users strategy when clicking the Add button', async () => { - wrapper.find(GlButton).vm.$emit('click'); + wrapper.findComponent(GlButton).vm.$emit('click'); await nextTick(); - const strategies = wrapper.findAll(Strategy); + const strategies = wrapper.findAllComponents(Strategy); expect(strategies).toHaveLength(3); expect(strategies.at(2).props('strategy')).toEqual(allUsersStrategy); @@ -143,10 +143,10 @@ describe('feature flag form', () => { parameters: { percentage: '30' }, scopes: [], }; - wrapper.find(Strategy).vm.$emit('delete'); + wrapper.findComponent(Strategy).vm.$emit('delete'); await nextTick(); - expect(wrapper.findAll(Strategy)).toHaveLength(1); - expect(wrapper.find(Strategy).props('strategy')).not.toEqual(strategy); + expect(wrapper.findAllComponents(Strategy)).toHaveLength(1); + expect(wrapper.findComponent(Strategy).props('strategy')).not.toEqual(strategy); }); }); }); diff --git a/spec/frontend/feature_flags/components/new_environments_dropdown_spec.js b/spec/frontend/feature_flags/components/new_environments_dropdown_spec.js index 63fa5d19982..1c0c444c296 100644 --- a/spec/frontend/feature_flags/components/new_environments_dropdown_spec.js +++ b/spec/frontend/feature_flags/components/new_environments_dropdown_spec.js @@ -31,17 +31,17 @@ describe('New Environments Dropdown', () => { describe('before results', () => { it('should show a loading icon', () => { axiosMock.onGet(TEST_HOST).reply(() => { - expect(wrapper.find(GlLoadingIcon).exists()).toBe(true); + expect(wrapper.findComponent(GlLoadingIcon).exists()).toBe(true); }); - wrapper.find(GlSearchBoxByType).vm.$emit('focus'); + wrapper.findComponent(GlSearchBoxByType).vm.$emit('focus'); return axios.waitForAll(); }); it('should not show any dropdown items', () => { axiosMock.onGet(TEST_HOST).reply(() => { - expect(wrapper.findAll(GlDropdownItem)).toHaveLength(0); + expect(wrapper.findAllComponents(GlDropdownItem)).toHaveLength(0); }); - wrapper.find(GlSearchBoxByType).vm.$emit('focus'); + wrapper.findComponent(GlSearchBoxByType).vm.$emit('focus'); return axios.waitForAll(); }); }); @@ -50,11 +50,11 @@ describe('New Environments Dropdown', () => { let item; beforeEach(async () => { axiosMock.onGet(TEST_HOST).reply(200, []); - wrapper.find(GlSearchBoxByType).vm.$emit('focus'); - wrapper.find(GlSearchBoxByType).vm.$emit('input', TEST_SEARCH); + wrapper.findComponent(GlSearchBoxByType).vm.$emit('focus'); + wrapper.findComponent(GlSearchBoxByType).vm.$emit('input', TEST_SEARCH); await axios.waitForAll(); await nextTick(); - item = wrapper.find(GlDropdownItem); + item = wrapper.findComponent(GlDropdownItem); }); it('should display a Create item label', () => { @@ -62,7 +62,7 @@ describe('New Environments Dropdown', () => { }); it('should display that no matching items are found', () => { - expect(wrapper.find({ ref: 'noResults' }).exists()).toBe(true); + expect(wrapper.findComponent({ ref: 'noResults' }).exists()).toBe(true); }); it('should emit a new scope when selected', () => { @@ -75,10 +75,10 @@ describe('New Environments Dropdown', () => { let items; beforeEach(() => { axiosMock.onGet(TEST_HOST).reply(httpStatusCodes.OK, ['prod', 'production']); - wrapper.find(GlSearchBoxByType).vm.$emit('focus'); - wrapper.find(GlSearchBoxByType).vm.$emit('input', 'prod'); + wrapper.findComponent(GlSearchBoxByType).vm.$emit('focus'); + wrapper.findComponent(GlSearchBoxByType).vm.$emit('input', 'prod'); return axios.waitForAll().then(() => { - items = wrapper.findAll(GlDropdownItem); + items = wrapper.findAllComponents(GlDropdownItem); }); }); @@ -97,7 +97,7 @@ describe('New Environments Dropdown', () => { }); it('should not display a message about no results', () => { - expect(wrapper.find({ ref: 'noResults' }).exists()).toBe(false); + expect(wrapper.findComponent({ ref: 'noResults' }).exists()).toBe(false); }); }); }); diff --git a/spec/frontend/feature_flags/components/new_feature_flag_spec.js b/spec/frontend/feature_flags/components/new_feature_flag_spec.js index 688ba54f919..300d0e47082 100644 --- a/spec/frontend/feature_flags/components/new_feature_flag_spec.js +++ b/spec/frontend/feature_flags/components/new_feature_flag_spec.js @@ -40,7 +40,7 @@ describe('New feature flag form', () => { }; const findWarningGlAlert = () => - wrapper.findAll(GlAlert).filter((c) => c.props('variant') === 'warning'); + wrapper.findAllComponents(GlAlert).filter((c) => c.props('variant') === 'warning'); beforeEach(() => { factory(); @@ -65,11 +65,11 @@ describe('New feature flag form', () => { }); it('should render feature flag form', () => { - expect(wrapper.find(Form).exists()).toEqual(true); + expect(wrapper.findComponent(Form).exists()).toEqual(true); }); it('has an all users strategy by default', () => { - const strategies = wrapper.find(Form).props('strategies'); + const strategies = wrapper.findComponent(Form).props('strategies'); expect(strategies).toEqual([allUsersStrategy]); }); diff --git a/spec/frontend/feature_flags/components/strategies/flexible_rollout_spec.js b/spec/frontend/feature_flags/components/strategies/flexible_rollout_spec.js index 56b14d80ab3..70a9156b5a9 100644 --- a/spec/frontend/feature_flags/components/strategies/flexible_rollout_spec.js +++ b/spec/frontend/feature_flags/components/strategies/flexible_rollout_spec.js @@ -34,12 +34,12 @@ describe('feature_flags/components/strategies/flexible_rollout.vue', () => { percentageFormGroup = wrapper .find('[data-testid="strategy-flexible-rollout-percentage"]') - .find(ParameterFormGroup); - percentageInput = percentageFormGroup.find(GlFormInput); + .findComponent(ParameterFormGroup); + percentageInput = percentageFormGroup.findComponent(GlFormInput); stickinessFormGroup = wrapper .find('[data-testid="strategy-flexible-rollout-stickiness"]') - .find(ParameterFormGroup); - stickinessSelect = stickinessFormGroup.find(GlFormSelect); + .findComponent(ParameterFormGroup); + stickinessSelect = stickinessFormGroup.findComponent(GlFormSelect); }); it('displays the current percentage value', () => { @@ -94,7 +94,7 @@ describe('feature_flags/components/strategies/flexible_rollout.vue', () => { it('shows errors', () => { const formGroup = wrapper .find('[data-testid="strategy-flexible-rollout-percentage"]') - .find(ParameterFormGroup); + .findComponent(ParameterFormGroup); expect(formGroup.attributes('state')).toBeUndefined(); }); @@ -108,7 +108,7 @@ describe('feature_flags/components/strategies/flexible_rollout.vue', () => { it('shows errors', () => { const formGroup = wrapper .find('[data-testid="strategy-flexible-rollout-percentage"]') - .find(ParameterFormGroup); + .findComponent(ParameterFormGroup); expect(formGroup.attributes('state')).toBeUndefined(); }); diff --git a/spec/frontend/feature_flags/components/strategies/gitlab_user_list_spec.js b/spec/frontend/feature_flags/components/strategies/gitlab_user_list_spec.js index 3b69194494f..96b9434f3ec 100644 --- a/spec/frontend/feature_flags/components/strategies/gitlab_user_list_spec.js +++ b/spec/frontend/feature_flags/components/strategies/gitlab_user_list_spec.js @@ -24,10 +24,10 @@ describe('~/feature_flags/components/strategies/gitlab_user_list.vue', () => { propsData: { ...DEFAULT_PROPS, ...props }, }); - const findDropdown = () => wrapper.find(GlDropdown); + const findDropdown = () => wrapper.findComponent(GlDropdown); describe('with user lists', () => { - const findDropdownItem = () => wrapper.find(GlDropdownItem); + const findDropdownItem = () => wrapper.findComponent(GlDropdownItem); beforeEach(() => { Api.searchFeatureFlagUserLists.mockResolvedValue({ data: [userList] }); @@ -69,10 +69,10 @@ describe('~/feature_flags/components/strategies/gitlab_user_list.vue', () => { r = resolve; }), ); - const searchWrapper = wrapper.find(GlSearchBoxByType); + const searchWrapper = wrapper.findComponent(GlSearchBoxByType); searchWrapper.vm.$emit('input', 'new'); await nextTick(); - const loadingIcon = wrapper.find(GlLoadingIcon); + const loadingIcon = wrapper.findComponent(GlLoadingIcon); expect(loadingIcon.exists()).toBe(true); expect(Api.searchFeatureFlagUserLists).toHaveBeenCalledWith('1', 'new'); diff --git a/spec/frontend/feature_flags/components/strategies/parameter_form_group_spec.js b/spec/frontend/feature_flags/components/strategies/parameter_form_group_spec.js index 33696064d55..23ad0d3a08d 100644 --- a/spec/frontend/feature_flags/components/strategies/parameter_form_group_spec.js +++ b/spec/frontend/feature_flags/components/strategies/parameter_form_group_spec.js @@ -20,7 +20,7 @@ describe('~/feature_flags/strategies/parameter_form_group.vue', () => { }, }); - formGroup = wrapper.find(GlFormGroup); + formGroup = wrapper.findComponent(GlFormGroup); slot = wrapper.find('[data-testid="slot"]'); }); diff --git a/spec/frontend/feature_flags/components/strategies/percent_rollout_spec.js b/spec/frontend/feature_flags/components/strategies/percent_rollout_spec.js index 180697e93e4..cb422a018f9 100644 --- a/spec/frontend/feature_flags/components/strategies/percent_rollout_spec.js +++ b/spec/frontend/feature_flags/components/strategies/percent_rollout_spec.js @@ -30,8 +30,8 @@ describe('~/feature_flags/components/strategies/percent_rollout.vue', () => { beforeEach(() => { wrapper = factory(); - input = wrapper.find(GlFormInput); - formGroup = wrapper.find(ParameterFormGroup); + input = wrapper.findComponent(GlFormInput); + formGroup = wrapper.findComponent(ParameterFormGroup); }); it('displays the current value', () => { @@ -55,8 +55,8 @@ describe('~/feature_flags/components/strategies/percent_rollout.vue', () => { beforeEach(() => { wrapper = factory({ strategy: { parameters: { percentage: '101' } } }); - input = wrapper.find(GlFormInput); - formGroup = wrapper.find(ParameterFormGroup); + input = wrapper.findComponent(GlFormInput); + formGroup = wrapper.findComponent(ParameterFormGroup); }); it('shows errors', () => { @@ -68,8 +68,8 @@ describe('~/feature_flags/components/strategies/percent_rollout.vue', () => { beforeEach(() => { wrapper = factory({ strategy: { parameters: { percentage: '3.14' } } }); - input = wrapper.find(GlFormInput); - formGroup = wrapper.find(ParameterFormGroup); + input = wrapper.findComponent(GlFormInput); + formGroup = wrapper.findComponent(ParameterFormGroup); }); it('shows errors', () => { diff --git a/spec/frontend/feature_flags/components/strategies/users_with_id_spec.js b/spec/frontend/feature_flags/components/strategies/users_with_id_spec.js index 745fbca00fe..0a72714c22a 100644 --- a/spec/frontend/feature_flags/components/strategies/users_with_id_spec.js +++ b/spec/frontend/feature_flags/components/strategies/users_with_id_spec.js @@ -15,7 +15,7 @@ describe('~/feature_flags/components/users_with_id.vue', () => { beforeEach(() => { wrapper = factory(); - textarea = wrapper.find(GlFormTextarea); + textarea = wrapper.findComponent(GlFormTextarea); }); afterEach(() => { diff --git a/spec/frontend/feature_flags/components/strategy_parameters_spec.js b/spec/frontend/feature_flags/components/strategy_parameters_spec.js index 979ca255b08..d0f1f7d0e2a 100644 --- a/spec/frontend/feature_flags/components/strategy_parameters_spec.js +++ b/spec/frontend/feature_flags/components/strategy_parameters_spec.js @@ -51,11 +51,11 @@ describe('~/feature_flags/components/strategy_parameters.vue', () => { }); it('should show the correct component', () => { - expect(wrapper.find(component).exists()).toBe(true); + expect(wrapper.findComponent(component).exists()).toBe(true); }); it('should emit changes from the lower component', () => { - const strategyParameterWrapper = wrapper.find(component); + const strategyParameterWrapper = wrapper.findComponent(component); strategyParameterWrapper.vm.$emit('change', { parameters: { foo: 'bar' } }); @@ -77,7 +77,7 @@ describe('~/feature_flags/components/strategy_parameters.vue', () => { strategy, }); - expect(wrapper.find(UsersWithId).props('strategy')).toEqual(strategy); + expect(wrapper.findComponent(UsersWithId).props('strategy')).toEqual(strategy); }); }); }); diff --git a/spec/frontend/feature_flags/components/strategy_spec.js b/spec/frontend/feature_flags/components/strategy_spec.js index aee3873721c..84d4180fe63 100644 --- a/spec/frontend/feature_flags/components/strategy_spec.js +++ b/spec/frontend/feature_flags/components/strategy_spec.js @@ -32,8 +32,8 @@ Vue.use(Vuex); describe('Feature flags strategy', () => { let wrapper; - const findStrategyParameters = () => wrapper.find(StrategyParameters); - const findDocsLinks = () => wrapper.findAll(GlLink); + const findStrategyParameters = () => wrapper.findComponent(StrategyParameters); + const findDocsLinks = () => wrapper.findAllComponents(GlLink); const factory = ( opts = { @@ -93,7 +93,7 @@ describe('Feature flags strategy', () => { }); it('should set the select to match the strategy name', () => { - expect(wrapper.find(GlFormSelect).element.value).toBe(name); + expect(wrapper.findComponent(GlFormSelect).element.value).toBe(name); }); it('should emit a change if the parameters component does', () => { @@ -118,7 +118,7 @@ describe('Feature flags strategy', () => { }); it('shows an alert asking users to consider using flexibleRollout instead', () => { - expect(wrapper.find(GlAlert).text()).toContain( + expect(wrapper.findComponent(GlAlert).text()).toContain( 'Consider using the more flexible "Percent rollout" strategy instead.', ); }); @@ -139,10 +139,10 @@ describe('Feature flags strategy', () => { }); it('should revert to all-environments scope when last scope is removed', async () => { - const token = wrapper.find(GlToken); + const token = wrapper.findComponent(GlToken); token.vm.$emit('close'); await nextTick(); - expect(wrapper.findAll(GlToken)).toHaveLength(0); + expect(wrapper.findAllComponents(GlToken)).toHaveLength(0); expect(last(wrapper.emitted('change'))).toEqual([ { name: ROLLOUT_STRATEGY_PERCENT_ROLLOUT, @@ -167,7 +167,7 @@ describe('Feature flags strategy', () => { }); it('should change the parameters if a different strategy is chosen', async () => { - const select = wrapper.find(GlFormSelect); + const select = wrapper.findComponent(GlFormSelect); select.setValue(ROLLOUT_STRATEGY_ALL_USERS); await nextTick(); expect(last(wrapper.emitted('change'))).toEqual([ @@ -180,26 +180,26 @@ describe('Feature flags strategy', () => { }); it('should display selected scopes', async () => { - const dropdown = wrapper.find(NewEnvironmentsDropdown); + const dropdown = wrapper.findComponent(NewEnvironmentsDropdown); dropdown.vm.$emit('add', 'production'); await nextTick(); - expect(wrapper.findAll(GlToken)).toHaveLength(1); - expect(wrapper.find(GlToken).text()).toBe('production'); + expect(wrapper.findAllComponents(GlToken)).toHaveLength(1); + expect(wrapper.findComponent(GlToken).text()).toBe('production'); }); it('should display all selected scopes', async () => { - const dropdown = wrapper.find(NewEnvironmentsDropdown); + const dropdown = wrapper.findComponent(NewEnvironmentsDropdown); dropdown.vm.$emit('add', 'production'); dropdown.vm.$emit('add', 'staging'); await nextTick(); - const tokens = wrapper.findAll(GlToken); + const tokens = wrapper.findAllComponents(GlToken); expect(tokens).toHaveLength(2); expect(tokens.at(0).text()).toBe('production'); expect(tokens.at(1).text()).toBe('staging'); }); it('should emit selected scopes', async () => { - const dropdown = wrapper.find(NewEnvironmentsDropdown); + const dropdown = wrapper.findComponent(NewEnvironmentsDropdown); dropdown.vm.$emit('add', 'production'); await nextTick(); expect(last(wrapper.emitted('change'))).toEqual([ @@ -215,7 +215,7 @@ describe('Feature flags strategy', () => { }); it('should emit a delete if the delete button is clicked', () => { - wrapper.find(GlButton).vm.$emit('click'); + wrapper.findComponent(GlButton).vm.$emit('click'); expect(wrapper.emitted('delete')).toEqual([[]]); }); }); @@ -232,26 +232,26 @@ describe('Feature flags strategy', () => { }); it('should display selected scopes', async () => { - const dropdown = wrapper.find(NewEnvironmentsDropdown); + const dropdown = wrapper.findComponent(NewEnvironmentsDropdown); dropdown.vm.$emit('add', 'production'); await nextTick(); - expect(wrapper.findAll(GlToken)).toHaveLength(1); - expect(wrapper.find(GlToken).text()).toBe('production'); + expect(wrapper.findAllComponents(GlToken)).toHaveLength(1); + expect(wrapper.findComponent(GlToken).text()).toBe('production'); }); it('should display all selected scopes', async () => { - const dropdown = wrapper.find(NewEnvironmentsDropdown); + const dropdown = wrapper.findComponent(NewEnvironmentsDropdown); dropdown.vm.$emit('add', 'production'); dropdown.vm.$emit('add', 'staging'); await nextTick(); - const tokens = wrapper.findAll(GlToken); + const tokens = wrapper.findAllComponents(GlToken); expect(tokens).toHaveLength(2); expect(tokens.at(0).text()).toBe('production'); expect(tokens.at(1).text()).toBe('staging'); }); it('should emit selected scopes', async () => { - const dropdown = wrapper.find(NewEnvironmentsDropdown); + const dropdown = wrapper.findComponent(NewEnvironmentsDropdown); dropdown.vm.$emit('add', 'production'); await nextTick(); expect(last(wrapper.emitted('change'))).toEqual([ |