summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMartin Wortschack <mwortschack@gitlab.com>2018-12-15 10:50:39 +0100
committerMartin Wortschack <mwortschack@gitlab.com>2018-12-15 10:50:46 +0100
commit60295c1430efa7000b7876df8617e379a08684a2 (patch)
treeff211f946505332bbbaaf42648c97c2a2e452df2 /spec
parentc027101d34ebdbd935e2c2b35827323c110b3654 (diff)
downloadgitlab-ce-60295c1430efa7000b7876df8617e379a08684a2.tar.gz
Fix broken karma test
Diffstat (limited to 'spec')
-rw-r--r--spec/javascripts/boards/components/issue_due_date_spec.js7
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', () => {