summaryrefslogtreecommitdiff
path: root/spec/javascripts/build_spec.js.es6
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-11-24 11:32:59 +0000
committerPhil Hughes <me@iamphill.com>2016-11-24 11:32:59 +0000
commit8c4f4afd6dd6d382aab2d6b992b6ffe3e60f91af (patch)
tree37d3ff76dc31e7fcfa63eb8c2f54c9d84eb9b88a /spec/javascripts/build_spec.js.es6
parent03a235783f697572fe201332cb82746401a01daf (diff)
parent3e44ed3e2bf75bb14a2d8b0466b3d92afd0ea067 (diff)
downloadgitlab-ce-autocomplete-space-prefix.tar.gz
Merge branch 'master' into autocomplete-space-prefixautocomplete-space-prefix
Diffstat (limited to 'spec/javascripts/build_spec.js.es6')
-rw-r--r--spec/javascripts/build_spec.js.es618
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/javascripts/build_spec.js.es6 b/spec/javascripts/build_spec.js.es6
index 370944b6a8c..4208e076e96 100644
--- a/spec/javascripts/build_spec.js.es6
+++ b/spec/javascripts/build_spec.js.es6
@@ -1,5 +1,8 @@
-/* global Build */
/* eslint-disable no-new */
+/* global Build */
+/* global Turbolinks */
+
+//= require lib/utils/datetime_utility
//= require build
//= require breakpoints
//= require jquery.nicescroll
@@ -24,7 +27,15 @@
});
describe('setup', function () {
+ const removeDate = new Date();
+ removeDate.setUTCFullYear(removeDate.getUTCFullYear() + 1);
+ // give the test three days to run
+ removeDate.setTime(removeDate.getTime() + (3 * 24 * 60 * 60 * 1000));
+
beforeEach(function () {
+ const removeDateElement = document.querySelector('.js-artifacts-remove');
+ removeDateElement.innerText = removeDate.toString();
+
this.build = new Build();
});
@@ -54,6 +65,11 @@
expect($('.build-job[data-stage="test"]').is(':visible')).toBe(false);
expect($('.build-job[data-stage="deploy"]').is(':visible')).toBe(false);
});
+
+ it('displays the remove date correctly', function () {
+ const removeDateElement = document.querySelector('.js-artifacts-remove');
+ expect(removeDateElement.innerText.trim()).toBe('1 year');
+ });
});
describe('initial build trace', function () {