diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-23 21:08:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-23 21:08:27 +0300 |
commit | 3ca896b640def57a58485def308748b2fccbd0bb (patch) | |
tree | 7aead6484759d2a473bf9776aa7d87632f1e105f /spec/frontend/super_sidebar | |
parent | abdb550f6937ce69ec38954f24ef221d07637438 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/super_sidebar')
-rw-r--r-- | spec/frontend/super_sidebar/components/create_menu_spec.js | 12 | ||||
-rw-r--r-- | spec/frontend/super_sidebar/components/help_center_spec.js | 17 |
2 files changed, 1 insertions, 28 deletions
diff --git a/spec/frontend/super_sidebar/components/create_menu_spec.js b/spec/frontend/super_sidebar/components/create_menu_spec.js index 456085e23da..6c26947f9ce 100644 --- a/spec/frontend/super_sidebar/components/create_menu_spec.js +++ b/spec/frontend/super_sidebar/components/create_menu_spec.js @@ -6,7 +6,6 @@ import { GlDisclosureDropdownItem, } from '@gitlab/ui'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; -import { stubComponent } from 'helpers/stub_component'; import InviteMembersTrigger from '~/invite_members/components/invite_members_trigger.vue'; import { __ } from '~/locale'; import CreateMenu from '~/super_sidebar/components/create_menu.vue'; @@ -21,8 +20,6 @@ describe('CreateMenu component', () => { const findInviteMembersTrigger = () => wrapper.findComponent(InviteMembersTrigger); const findGlTooltip = () => wrapper.findComponent(GlTooltip); - const closeAndFocusMock = jest.fn(); - const createWrapper = () => { wrapper = shallowMountExtended(CreateMenu, { propsData: { @@ -30,9 +27,7 @@ describe('CreateMenu component', () => { }, stubs: { InviteMembersTrigger, - GlDisclosureDropdown: stubComponent(GlDisclosureDropdown, { - methods: { closeAndFocus: closeAndFocusMock }, - }), + GlDisclosureDropdown, }, }); }; @@ -93,10 +88,5 @@ describe('CreateMenu component', () => { expect(findGlTooltip().exists()).toBe(true); }); - - it('closes the dropdown when invite members modal is opened', () => { - findInviteMembersTrigger().vm.$emit('modal-opened'); - expect(closeAndFocusMock).toHaveBeenCalled(); - }); }); }); diff --git a/spec/frontend/super_sidebar/components/help_center_spec.js b/spec/frontend/super_sidebar/components/help_center_spec.js index a727fe6c243..204a64dd3a0 100644 --- a/spec/frontend/super_sidebar/components/help_center_spec.js +++ b/spec/frontend/super_sidebar/components/help_center_spec.js @@ -100,7 +100,6 @@ describe('HelpCenter component', () => { describe('with show_tanuki_bot true', () => { beforeEach(() => { createWrapper({ ...sidebarData, show_tanuki_bot: true }); - jest.spyOn(wrapper.vm.$refs.dropdown, 'close'); }); it('shows Ask GitLab Chat with the help items', () => { @@ -119,10 +118,6 @@ describe('HelpCenter component', () => { findButton('Ask GitLab Chat').click(); }); - it('closes the dropdown', () => { - expect(wrapper.vm.$refs.dropdown.close).toHaveBeenCalled(); - }); - it('sets helpCenterState.showTanukiBotChatDrawer to true', () => { expect(helpCenterState.showTanukiBotChatDrawer).toBe(true); }); @@ -150,16 +145,9 @@ describe('HelpCenter component', () => { let button; beforeEach(() => { - jest.spyOn(wrapper.vm.$refs.dropdown, 'close'); - button = findButton('Keyboard shortcuts ?'); }); - it('closes the dropdown', () => { - button.click(); - expect(wrapper.vm.$refs.dropdown.close).toHaveBeenCalled(); - }); - it('shows the keyboard shortcuts modal', () => { // This relies on the event delegation set up by the Shortcuts class in // ~/behaviors/shortcuts/shortcuts.js. @@ -179,17 +167,12 @@ describe('HelpCenter component', () => { describe('showWhatsNew', () => { beforeEach(() => { - jest.spyOn(wrapper.vm.$refs.dropdown, 'close'); beforeEach(() => { createWrapper({ ...sidebarData, show_version_check: true }); }); findButton("What's new 5").click(); }); - it('closes the dropdown', () => { - expect(wrapper.vm.$refs.dropdown.close).toHaveBeenCalled(); - }); - it('shows the "What\'s new" slideout', () => { expect(toggleWhatsNewDrawer).toHaveBeenCalledWith(expect.any(Object)); }); |