Commit 8b460204 authored by Stan Hu's avatar Stan Hu

Merge branch...

Merge branch '55402-broken-master-karma-test-failing-in-spec-javascripts-boards-components-issue_due_date_spec-js' into 'master'

Resolve "Broken master: karma test failing in spec/javascripts/boards/components/issue_due_date_spec.js"

Closes #55402

See merge request gitlab-org/gitlab-ce!23845
parents 8d2e1b72 60295c14
...@@ -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