diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-23 12:08:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-23 12:08:33 +0300 |
commit | 897fe87f08c8819ba6b7baa8024c8141acf290f5 (patch) | |
tree | 82e2c5a5c0657def750c4893584a82cf9e69fefe /spec/frontend | |
parent | 88a927ae902b064bb35971e093dcfa228983a52c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
-rw-r--r-- | spec/frontend/projects/compare/components/app_spec.js | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/spec/frontend/projects/compare/components/app_spec.js b/spec/frontend/projects/compare/components/app_spec.js index ee96f46ea0c..f8c10311974 100644 --- a/spec/frontend/projects/compare/components/app_spec.js +++ b/spec/frontend/projects/compare/components/app_spec.js @@ -1,4 +1,4 @@ -import { GlButton } from '@gitlab/ui'; +import { GlButton, GlCollapsibleListbox } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import { nextTick } from 'vue'; import CompareApp from '~/projects/compare/components/app.vue'; @@ -18,6 +18,7 @@ describe('CompareApp component', () => { ...defaultProps, ...props, }, + stubs: { GlCollapsibleListbox }, }); }; @@ -130,14 +131,14 @@ describe('CompareApp component', () => { }); describe('mode dropdown', () => { - const findModeDropdownButton = () => wrapper.find('[data-testid="modeDropdown"]'); + const findGlDropdown = () => wrapper.findComponent(GlCollapsibleListbox); const findEnableStraightModeButton = () => - wrapper.find('[data-testid="enableStraightModeButton"]'); + wrapper.findComponent('[data-testid="listbox-item-true"]'); const findDisableStraightModeButton = () => - wrapper.find('[data-testid="disableStraightModeButton"]'); + wrapper.findComponent('[data-testid="listbox-item-false"]'); it('renders the mode dropdown button', () => { - expect(findModeDropdownButton().exists()).toBe(true); + expect(findGlDropdown().exists()).toBe(true); }); it('has the correct text', () => { @@ -146,17 +147,13 @@ describe('CompareApp component', () => { }); it('straight mode button when clicked', async () => { - expect(wrapper.props('straight')).toBe(false); expect(wrapper.find('input[name="straight"]').attributes('value')).toBe('false'); - findEnableStraightModeButton().vm.$emit('click'); - + findGlDropdown().vm.$emit('select', 'true'); await nextTick(); expect(wrapper.find('input[name="straight"]').attributes('value')).toBe('true'); - - findDisableStraightModeButton().vm.$emit('click'); - + findGlDropdown().vm.$emit('select', 'false'); await nextTick(); expect(wrapper.find('input[name="straight"]').attributes('value')).toBe('false'); |