Skip to content

Commit

Permalink
Fix broken karma test
Browse files Browse the repository at this point in the history
  • Loading branch information
wortschi committed Dec 15, 2018
1 parent c027101 commit 60295c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Fix due date test
merge_request: 23845
author:
type: other
7 changes: 4 additions & 3 deletions spec/javascripts/boards/components/issue_due_date_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ describe('Issue Due Date component', () => {
it('should render month and day for other dates', () => {
date.setDate(date.getDate() + 17);
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(
dateFormat(date, 'mmm d', true),
);
expect(vm.$el.querySelector('time').textContent.trim()).toEqual(dateFormat(date, format, true));
});

it('should contain the correct `.text-danger` css class for overdue issue', () => {
Expand Down

0 comments on commit 60295c1

Please sign in to comment.