Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Luís <aluis@gitlab.com>2018-12-17 19:39:08 +0300
committerAndré Luís <aluis@gitlab.com>2018-12-17 19:39:08 +0300
commit498400561d496521053dc5c55798a502d7354043 (patch)
treef7c5c614f6d32749ad2a5c5d89f07adbd2187d4c
parent213891fa43b0aa3edf28011bad25b42a490000d1 (diff)
Fix karma test that crosses over to next yearandr3-fix-broken-karma-date
-rw-r--r--spec/javascripts/boards/components/issue_due_date_spec.js6
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),
);
});