Commit 60295c14 authored by Martin Wortschack's avatar Martin Wortschack

Fix broken karma test

parent c027101d
...@@ -49,10 +49,11 @@ describe('Issue Due Date component', () => { ...@@ -49,10 +49,11 @@ describe('Issue Due Date component', () => {
it('should render month and day for other dates', () => { it('should render month and day for other dates', () => {
date.setDate(date.getDate() + 17); date.setDate(date.getDate() + 17);
vm = createComponent(date); vm = createComponent(date);
const today = new Date();
const isDueInCurrentYear = today.getFullYear() === date.getFullYear();
const format = isDueInCurrentYear ? 'mmm d' : 'mmm d, yyyy';
expect(vm.$el.querySelector('time').textContent.trim()).toEqual( expect(vm.$el.querySelector('time').textContent.trim()).toEqual(dateFormat(date, format, true));
dateFormat(date, 'mmm d', true),
);
}); });
it('should contain the correct `.text-danger` css class for overdue issue', () => { it('should contain the correct `.text-danger` css class for overdue issue', () => {
......
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