diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /spec/frontend/boards/components/board_content_sidebar_spec.js | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'spec/frontend/boards/components/board_content_sidebar_spec.js')
-rw-r--r-- | spec/frontend/boards/components/board_content_sidebar_spec.js | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/spec/frontend/boards/components/board_content_sidebar_spec.js b/spec/frontend/boards/components/board_content_sidebar_spec.js index 10d739c65f5..8a8250205d0 100644 --- a/spec/frontend/boards/components/board_content_sidebar_spec.js +++ b/spec/frontend/boards/components/board_content_sidebar_spec.js @@ -1,5 +1,6 @@ import { GlDrawer } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; +import { MountingPortal } from 'portal-vue'; import Vuex from 'vuex'; import SidebarDropdownWidget from 'ee_else_ce/sidebar/components/sidebar_dropdown_widget.vue'; import { stubComponent } from 'helpers/stub_component'; @@ -9,7 +10,8 @@ import BoardSidebarTitle from '~/boards/components/sidebar/board_sidebar_title.v import { ISSUABLE } from '~/boards/constants'; import SidebarDateWidget from '~/sidebar/components/date/sidebar_date_widget.vue'; import SidebarSubscriptionsWidget from '~/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue'; -import { mockIssue, mockIssueGroupPath, mockIssueProjectPath } from '../mock_data'; +import SidebarTodoWidget from '~/sidebar/components/todo_toggle/sidebar_todo_widget.vue'; +import { mockActiveIssue, mockIssue, mockIssueGroupPath, mockIssueProjectPath } from '../mock_data'; describe('BoardContentSidebar', () => { let wrapper; @@ -25,7 +27,7 @@ describe('BoardContentSidebar', () => { }, getters: { activeBoardItem: () => { - return { ...mockIssue, epic: null }; + return { ...mockActiveIssue, epic: null }; }, groupPathForActiveIssue: () => mockIssueGroupPath, projectPathForActiveIssue: () => mockIssueProjectPath, @@ -90,6 +92,14 @@ describe('BoardContentSidebar', () => { expect(wrapper.findComponent(GlDrawer).exists()).toBe(true); }); + it('confirms we render MountingPortal', () => { + expect(wrapper.find(MountingPortal).props()).toMatchObject({ + mountTo: '#js-right-sidebar-portal', + append: true, + name: 'board-content-sidebar', + }); + }); + it('does not render GlDrawer when isSidebarOpen is false', () => { createStore({ mockGetters: { isSidebarOpen: () => false } }); createComponent(); @@ -101,6 +111,10 @@ describe('BoardContentSidebar', () => { expect(wrapper.findComponent(GlDrawer).props('open')).toBe(true); }); + it('renders SidebarTodoWidget', () => { + expect(wrapper.findComponent(SidebarTodoWidget).exists()).toBe(true); + }); + it('renders BoardSidebarLabelsSelect', () => { expect(wrapper.findComponent(BoardSidebarLabelsSelect).exists()).toBe(true); }); @@ -138,7 +152,7 @@ describe('BoardContentSidebar', () => { expect(toggleBoardItem).toHaveBeenCalledTimes(1); expect(toggleBoardItem).toHaveBeenCalledWith(expect.any(Object), { - boardItem: { ...mockIssue, epic: null }, + boardItem: { ...mockActiveIssue, epic: null }, sidebarType: ISSUABLE, }); }); |