Commit b986e80a authored by Phil Hughes's avatar Phil Hughes

Merge branch 'kp-fix-roadmap-timeline-scroll-bug' into 'master'

Fixes Roadmap timeline bars not expanding on scroll

See merge request gitlab-org/gitlab!22207
parents f6a87d13 844caf46
...@@ -31,27 +31,29 @@ export default { ...@@ -31,27 +31,29 @@ export default {
required: true, required: true,
}, },
}, },
data() { computed: {
const { startDate, endDate } = this.epic; epicStartDateValues() {
const { startDate } = this.epic;
return { return {
epicStartDateValues: {
day: startDate.getDay(), day: startDate.getDay(),
date: startDate.getDate(), date: startDate.getDate(),
month: startDate.getMonth(), month: startDate.getMonth(),
year: startDate.getFullYear(), year: startDate.getFullYear(),
time: startDate.getTime(), time: startDate.getTime(),
}, };
epicEndDateValues: { },
epicEndDateValues() {
const { endDate } = this.epic;
return {
day: endDate.getDay(), day: endDate.getDay(),
date: endDate.getDate(), date: endDate.getDate(),
month: endDate.getMonth(), month: endDate.getMonth(),
year: endDate.getFullYear(), year: endDate.getFullYear(),
time: endDate.getTime(), time: endDate.getTime(),
}, };
}; },
},
computed: {
hasStartDate() { hasStartDate() {
if (this.presetType === PRESET_TYPES.QUARTERS) { if (this.presetType === PRESET_TYPES.QUARTERS) {
return this.hasStartDateForQuarter(); return this.hasStartDateForQuarter();
......
...@@ -33,29 +33,37 @@ describe('EpicItemTimelineComponent', () => { ...@@ -33,29 +33,37 @@ describe('EpicItemTimelineComponent', () => {
vm.$destroy(); vm.$destroy();
}); });
describe('data', () => { describe('computed', () => {
it('returns default data props', () => { beforeEach(() => {
vm = createComponent({}); vm = createComponent({});
});
expect(vm.epicStartDateValues).toEqual( describe('epicStartDateValues', () => {
jasmine.objectContaining({ it('returns object containing date parts from epic.startDate', () => {
day: mockEpic.startDate.getDay(), expect(vm.epicStartDateValues).toEqual(
date: mockEpic.startDate.getDate(), jasmine.objectContaining({
month: mockEpic.startDate.getMonth(), day: mockEpic.startDate.getDay(),
year: mockEpic.startDate.getFullYear(), date: mockEpic.startDate.getDate(),
time: mockEpic.startDate.getTime(), month: mockEpic.startDate.getMonth(),
}), year: mockEpic.startDate.getFullYear(),
); time: mockEpic.startDate.getTime(),
}),
expect(vm.epicEndDateValues).toEqual( );
jasmine.objectContaining({ });
day: mockEpic.endDate.getDay(), });
date: mockEpic.endDate.getDate(),
month: mockEpic.endDate.getMonth(), describe('epicEndDateValues', () => {
year: mockEpic.endDate.getFullYear(), it('returns object containing date parts from epic.endDate', () => {
time: mockEpic.endDate.getTime(), expect(vm.epicEndDateValues).toEqual(
}), jasmine.objectContaining({
); day: mockEpic.endDate.getDay(),
date: mockEpic.endDate.getDate(),
month: mockEpic.endDate.getMonth(),
year: mockEpic.endDate.getFullYear(),
time: mockEpic.endDate.getTime(),
}),
);
});
}); });
}); });
......
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