diff options
author | Stan Hu <stanhu@gmail.com> | 2018-12-16 04:11:16 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-12-16 04:11:16 +0300 |
commit | 8b4602041cf2c4a8738a4796d78720017249249f (patch) | |
tree | 321f7415da226fe2e49d470410ae58d55ccfc7ee /spec/javascripts | |
parent | 8d2e1b724bd515c5977090d722b915f374218eb3 (diff) | |
parent | 60295c1430efa7000b7876df8617e379a08684a2 (diff) |
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
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/boards/components/issue_due_date_spec.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/javascripts/boards/components/issue_due_date_spec.js b/spec/javascripts/boards/components/issue_due_date_spec.js index 9e49330c052..054cf8c5b7d 100644 --- a/spec/javascripts/boards/components/issue_due_date_spec.js +++ b/spec/javascripts/boards/components/issue_due_date_spec.js @@ -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', () => { |