diff options
author | André Luís <aluis@gitlab.com> | 2018-12-17 16:39:08 +0000 |
---|---|---|
committer | André Luís <aluis@gitlab.com> | 2018-12-17 16:39:08 +0000 |
commit | 498400561d496521053dc5c55798a502d7354043 (patch) | |
tree | f7c5c614f6d32749ad2a5c5d89f07adbd2187d4c | |
parent | 213891fa43b0aa3edf28011bad25b42a490000d1 (diff) | |
download | gitlab-ce-andr3-fix-broken-karma-date.tar.gz |
Fix karma test that crosses over to next yearandr3-fix-broken-karma-date
-rw-r--r-- | spec/javascripts/boards/components/issue_due_date_spec.js | 6 |
1 files changed, 5 insertions, 1 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..f7dc40723be 100644 --- a/spec/javascripts/boards/components/issue_due_date_spec.js +++ b/spec/javascripts/boards/components/issue_due_date_spec.js @@ -50,8 +50,12 @@ describe('Issue Due Date component', () => { date.setDate(date.getDate() + 17); vm = createComponent(date); + const currentYear = new Date().getFullYear(); + expect(vm.$el.querySelector('time').textContent.trim()).toEqual( - dateFormat(date, 'mmm d', true), + date.getFullYear() !== currentYear + ? dateFormat(date, 'mmm d, yyyy', true) + : dateFormat(date, 'mmm d', true), ); }); |