Commit 844caf46 authored by Kushal Pandya's avatar Kushal Pandya

Fixes timeline bars not expanding on scroll

parent 7c154fe7
...@@ -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,10 +33,13 @@ describe('EpicItemTimelineComponent', () => { ...@@ -33,10 +33,13 @@ describe('EpicItemTimelineComponent', () => {
vm.$destroy(); vm.$destroy();
}); });
describe('data', () => { describe('computed', () => {
it('returns default data props', () => { beforeEach(() => {
vm = createComponent({}); vm = createComponent({});
});
describe('epicStartDateValues', () => {
it('returns object containing date parts from epic.startDate', () => {
expect(vm.epicStartDateValues).toEqual( expect(vm.epicStartDateValues).toEqual(
jasmine.objectContaining({ jasmine.objectContaining({
day: mockEpic.startDate.getDay(), day: mockEpic.startDate.getDay(),
...@@ -46,7 +49,11 @@ describe('EpicItemTimelineComponent', () => { ...@@ -46,7 +49,11 @@ describe('EpicItemTimelineComponent', () => {
time: mockEpic.startDate.getTime(), time: mockEpic.startDate.getTime(),
}), }),
); );
});
});
describe('epicEndDateValues', () => {
it('returns object containing date parts from epic.endDate', () => {
expect(vm.epicEndDateValues).toEqual( expect(vm.epicEndDateValues).toEqual(
jasmine.objectContaining({ jasmine.objectContaining({
day: mockEpic.endDate.getDay(), day: mockEpic.endDate.getDay(),
...@@ -58,6 +65,7 @@ describe('EpicItemTimelineComponent', () => { ...@@ -58,6 +65,7 @@ describe('EpicItemTimelineComponent', () => {
); );
}); });
}); });
});
describe('template', () => { describe('template', () => {
it('renders component container element with class `epic-timeline-cell`', () => { it('renders component container element with class `epic-timeline-cell`', () => {
......
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