diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-07 21:09:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-07 21:09:51 +0300 |
commit | 9ee2305f46a2b3d1d1e8a1f1182512599a74dbe1 (patch) | |
tree | 82c0631433839156f7d2fa88a5026c385b2b5703 /spec/frontend/jobs | |
parent | 9498dc957345829f29fe0bc4e55c969783b457be (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/jobs')
-rw-r--r-- | spec/frontend/jobs/components/job/stages_dropdown_spec.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/spec/frontend/jobs/components/job/stages_dropdown_spec.js b/spec/frontend/jobs/components/job/stages_dropdown_spec.js index 9d01dc50e96..c42edc62183 100644 --- a/spec/frontend/jobs/components/job/stages_dropdown_spec.js +++ b/spec/frontend/jobs/components/job/stages_dropdown_spec.js @@ -1,4 +1,4 @@ -import { GlDropdown, GlDropdownItem, GlLink, GlSprintf } from '@gitlab/ui'; +import { GlDisclosureDropdown, GlLink, GlSprintf } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import { Mousetrap } from '~/lib/mousetrap'; import { extendedWrapper } from 'helpers/vue_test_utils_helper'; @@ -16,8 +16,8 @@ describe('Stages Dropdown', () => { let wrapper; const findStatus = () => wrapper.findComponent(CiIcon); - const findSelectedStageText = () => wrapper.findComponent(GlDropdown).props('text'); - const findStageItem = (index) => wrapper.findAllComponents(GlDropdownItem).at(index); + const findDropdown = () => wrapper.findComponent(GlDisclosureDropdown); + const findSelectedStageText = () => findDropdown().props('toggleText'); const findPipelineInfoText = () => wrapper.findByTestId('pipeline-info').text(); @@ -50,10 +50,13 @@ describe('Stages Dropdown', () => { }); it('renders dropdown with stages', () => { - expect(findStageItem(0).text()).toBe('build'); + expect(findDropdown().props('items')).toEqual([ + expect.objectContaining({ text: 'build' }), + expect.objectContaining({ text: 'test' }), + ]); }); - it('rendes selected stage', () => { + it('renders selected stage', () => { expect(findSelectedStageText()).toBe('deploy'); }); }); |