diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-01 15:09:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-01 15:09:50 +0300 |
commit | 02f6aecd47c847bb2a7d101678813fe5077ae299 (patch) | |
tree | 886df070fd7a3b3f0d364e879b89ea5eb31aeada /spec/frontend/super_sidebar/components/user_bar_spec.js | |
parent | 5ffb2b7bcde1c76f939c5dca2ff65bac3404a88f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/super_sidebar/components/user_bar_spec.js')
-rw-r--r-- | spec/frontend/super_sidebar/components/user_bar_spec.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/frontend/super_sidebar/components/user_bar_spec.js b/spec/frontend/super_sidebar/components/user_bar_spec.js index 7734afb7416..b58b65f09f5 100644 --- a/spec/frontend/super_sidebar/components/user_bar_spec.js +++ b/spec/frontend/super_sidebar/components/user_bar_spec.js @@ -65,8 +65,20 @@ describe('UserBar component', () => { createWrapper(); }); - it('passes the "Create new..." menu groups to the create-menu component', () => { - expect(findCreateMenu().props('groups')).toBe(mockSidebarData.create_new_menu_groups); + describe('"Create new..." menu', () => { + describe('when there are no menu items for it', () => { + // This scenario usually happens for an "External" user. + it('does not render it', () => { + createWrapper({ sidebarData: { ...mockSidebarData, create_new_menu_groups: [] } }); + expect(findCreateMenu().exists()).toBe(false); + }); + }); + + describe('when there are menu items for it', () => { + it('passes the "Create new..." menu groups to the create-menu component', () => { + expect(findCreateMenu().props('groups')).toBe(mockSidebarData.create_new_menu_groups); + }); + }); }); it('passes the "Merge request" menu groups to the merge_request_menu component', () => { |