diff --git a/ee/app/assets/javascripts/epic/components/sidebar_items/sidebar_date_picker.vue b/ee/app/assets/javascripts/epic/components/sidebar_items/sidebar_date_picker.vue index 57833b7e2d9bb2367dba24b48a4181f3207004f6..8f03444b79f916a7b6822ea67d6a0529816912f0 100644 --- a/ee/app/assets/javascripts/epic/components/sidebar_items/sidebar_date_picker.vue +++ b/ee/app/assets/javascripts/epic/components/sidebar_items/sidebar_date_picker.vue @@ -246,8 +246,8 @@ export default { css-classes="date-warning-icon append-right-5 prepend-left-5" tab-index="0" /> - -  – + +  –  { expect(state.epicStartDateSaveInProgress).toBe(false); expect(state.startDateIsFixed).toBe(startDateIsFixed); expect(state.startDate).toBe(startDate); + expect(state.startDateFixed).toBe(startDate); }); it('Should set `epicDueDateSaveInProgress` flag on state to `false` and set `dueDateIsFixed` & `dueDate` values based on provided `dateTypeIsFixed` & `newDate` params when `dateType` param is `due`', () => { @@ -205,6 +206,35 @@ describe('Epic Store Mutations', () => { expect(state.epicDueDateSaveInProgress).toBe(false); expect(state.dueDateIsFixed).toBe(dueDateIsFixed); expect(state.dueDate).toBe(dueDate); + expect(state.dueDateFixed).toBe(dueDate); + }); + + it('Should not set `startDateFixed` on state when date changed is not of type fixed', () => { + const startDateIsFixed = false; + const startDate = '2018-1-1'; + const state = {}; + + mutations[types.REQUEST_EPIC_DATE_SAVE_SUCCESS](state, { + dateType: dateTypes.start, + dateTypeIsFixed: startDateIsFixed, + newDate: startDate, + }); + + expect(state.startDateFixed).toBeUndefined(); + }); + + it('Should not set `dueDateFixed` on state when date changed is not of type fixed', () => { + const dueDateIsFixed = false; + const dueDate = '2018-1-1'; + const state = {}; + + mutations[types.REQUEST_EPIC_DATE_SAVE_SUCCESS](state, { + dateType: dateTypes.due, + dateTypeIsFixed: dueDateIsFixed, + newDate: dueDate, + }); + + expect(state.dueDateFixed).toBeUndefined(); }); });