Commit 6810b0a9 authored by Miguel Rincon's avatar Miguel Rincon

Merge branch 'psi-foss-ee-unresolved' into 'master'

Fix some unresolved ee imports [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!56735
parents 2b1aa4d6 8710a4d0
<script> <script>
import { GlDrawer } from '@gitlab/ui'; import { GlDrawer } from '@gitlab/ui';
import { mapState, mapActions, mapGetters } from 'vuex'; import { mapState, mapActions, mapGetters } from 'vuex';
import BoardSidebarEpicSelect from 'ee_component/boards/components/sidebar/board_sidebar_epic_select.vue';
import BoardSidebarWeightInput from 'ee_component/boards/components/sidebar/board_sidebar_weight_input.vue';
import SidebarIterationWidget from 'ee_component/sidebar/components/sidebar_iteration_widget.vue';
import BoardSidebarDueDate from '~/boards/components/sidebar/board_sidebar_due_date.vue'; import BoardSidebarDueDate from '~/boards/components/sidebar/board_sidebar_due_date.vue';
import BoardSidebarIssueTitle from '~/boards/components/sidebar/board_sidebar_issue_title.vue'; import BoardSidebarIssueTitle from '~/boards/components/sidebar/board_sidebar_issue_title.vue';
import BoardSidebarLabelsSelect from '~/boards/components/sidebar/board_sidebar_labels_select.vue'; import BoardSidebarLabelsSelect from '~/boards/components/sidebar/board_sidebar_labels_select.vue';
...@@ -26,9 +23,12 @@ export default { ...@@ -26,9 +23,12 @@ export default {
BoardSidebarDueDate, BoardSidebarDueDate,
BoardSidebarSubscription, BoardSidebarSubscription,
BoardSidebarMilestoneSelect, BoardSidebarMilestoneSelect,
BoardSidebarEpicSelect, BoardSidebarEpicSelect: () =>
SidebarIterationWidget, import('ee_component/boards/components/sidebar/board_sidebar_epic_select.vue'),
BoardSidebarWeightInput, BoardSidebarWeightInput: () =>
import('ee_component/boards/components/sidebar/board_sidebar_weight_input.vue'),
SidebarIterationWidget: () =>
import('ee_component/sidebar/components/sidebar_iteration_widget.vue'),
}, },
mixins: [glFeatureFlagsMixin()], mixins: [glFeatureFlagsMixin()],
computed: { computed: {
......
...@@ -15,12 +15,14 @@ describe('ee/BoardContentSidebar', () => { ...@@ -15,12 +15,14 @@ describe('ee/BoardContentSidebar', () => {
store = new Vuex.Store({ store = new Vuex.Store({
state: { state: {
sidebarType: ISSUABLE, sidebarType: ISSUABLE,
issues: { [mockIssue.id]: mockIssue }, issues: { [mockIssue.id]: { ...mockIssue, epic: null } },
activeId: mockIssue.id, activeId: mockIssue.id,
issuableType: issuableTypes.issue, issuableType: issuableTypes.issue,
}, },
getters: { getters: {
activeIssue: () => mockIssue, activeIssue: () => {
return { ...mockIssue, epic: null };
},
projectPathForActiveIssue: () => mockIssueProjectPath, projectPathForActiveIssue: () => mockIssueProjectPath,
groupPathForActiveIssue: () => mockIssueGroupPath, groupPathForActiveIssue: () => mockIssueGroupPath,
isSidebarOpen: () => true, isSidebarOpen: () => true,
...@@ -31,11 +33,18 @@ describe('ee/BoardContentSidebar', () => { ...@@ -31,11 +33,18 @@ describe('ee/BoardContentSidebar', () => {
}; };
const createComponent = () => { const createComponent = () => {
/*
Dynamically imported components (in our case ee imports)
aren't stubbed automatically in VTU v1:
https://github.com/vuejs/vue-test-utils/issues/1279.
This requires us to additionally mock apollo or vuex stores.
*/
wrapper = shallowMount(BoardContentSidebar, { wrapper = shallowMount(BoardContentSidebar, {
provide: { provide: {
canUpdate: true, canUpdate: true,
rootPath: '/', rootPath: '/',
groupId: '#', groupId: 1,
}, },
store, store,
stubs: { stubs: {
...@@ -49,6 +58,12 @@ describe('ee/BoardContentSidebar', () => { ...@@ -49,6 +58,12 @@ describe('ee/BoardContentSidebar', () => {
participants: { participants: {
loading: false, loading: false,
}, },
currentIteration: {
loading: false,
},
iterations: {
loading: false,
},
}, },
}, },
}, },
......
...@@ -19,12 +19,14 @@ describe('BoardContentSidebar', () => { ...@@ -19,12 +19,14 @@ describe('BoardContentSidebar', () => {
store = new Vuex.Store({ store = new Vuex.Store({
state: { state: {
sidebarType: ISSUABLE, sidebarType: ISSUABLE,
issues: { [mockIssue.id]: mockIssue }, issues: { [mockIssue.id]: { ...mockIssue, epic: null } },
activeId: mockIssue.id, activeId: mockIssue.id,
issuableType: 'issue', issuableType: 'issue',
}, },
getters: { getters: {
activeIssue: () => mockIssue, activeIssue: () => {
return { ...mockIssue, epic: null };
},
groupPathForActiveIssue: () => mockIssueGroupPath, groupPathForActiveIssue: () => mockIssueGroupPath,
projectPathForActiveIssue: () => mockIssueProjectPath, projectPathForActiveIssue: () => mockIssueProjectPath,
isSidebarOpen: () => true, isSidebarOpen: () => true,
...@@ -35,11 +37,18 @@ describe('BoardContentSidebar', () => { ...@@ -35,11 +37,18 @@ describe('BoardContentSidebar', () => {
}; };
const createComponent = () => { const createComponent = () => {
/*
Dynamically imported components (in our case ee imports)
aren't stubbed automatically in VTU v1:
https://github.com/vuejs/vue-test-utils/issues/1279.
This requires us to additionally mock apollo or vuex stores.
*/
wrapper = shallowMount(BoardContentSidebar, { wrapper = shallowMount(BoardContentSidebar, {
provide: { provide: {
canUpdate: true, canUpdate: true,
rootPath: '/', rootPath: '/',
groupId: '#', groupId: 1,
}, },
store, store,
stubs: { stubs: {
...@@ -53,6 +62,12 @@ describe('BoardContentSidebar', () => { ...@@ -53,6 +62,12 @@ describe('BoardContentSidebar', () => {
participants: { participants: {
loading: false, loading: false,
}, },
currentIteration: {
loading: false,
},
iterations: {
loading: false,
},
}, },
}, },
}, },
...@@ -117,7 +132,7 @@ describe('BoardContentSidebar', () => { ...@@ -117,7 +132,7 @@ describe('BoardContentSidebar', () => {
expect(toggleBoardItem).toHaveBeenCalledTimes(1); expect(toggleBoardItem).toHaveBeenCalledTimes(1);
expect(toggleBoardItem).toHaveBeenCalledWith(expect.any(Object), { expect(toggleBoardItem).toHaveBeenCalledWith(expect.any(Object), {
boardItem: mockIssue, boardItem: { ...mockIssue, epic: null },
sidebarType: ISSUABLE, sidebarType: ISSUABLE,
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment