summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwinniehell <git@winniehell.de>2016-11-18 13:18:49 +0100
committerwinniehell <git@winniehell.de>2016-11-18 19:11:18 +0100
commit49e726ec331e2f765fae184e8e9dff42a94d5227 (patch)
tree0b4b4350c30dec1c19aab3728480b5602dd10360
parent2a085e5edddbeb7927d8f8d4413bed8a1ff74f49 (diff)
downloadgitlab-ce-49e726ec331e2f765fae184e8e9dff42a94d5227.tar.gz
Add failing test for #24614
-rw-r--r--spec/javascripts/build_spec.js.es613
-rw-r--r--spec/javascripts/fixtures/build.html.haml5
2 files changed, 18 insertions, 0 deletions
diff --git a/spec/javascripts/build_spec.js.es6 b/spec/javascripts/build_spec.js.es6
index b329ad8062a..e21e5844a26 100644
--- a/spec/javascripts/build_spec.js.es6
+++ b/spec/javascripts/build_spec.js.es6
@@ -26,7 +26,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();
});
@@ -56,6 +64,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 () {
diff --git a/spec/javascripts/fixtures/build.html.haml b/spec/javascripts/fixtures/build.html.haml
index a2bc81c6be7..27136beb14c 100644
--- a/spec/javascripts/fixtures/build.html.haml
+++ b/spec/javascripts/fixtures/build.html.haml
@@ -55,3 +55,8 @@
build_status: 'passed',
build_stage: 'test',
state1: 'buildstate' }}
+
+%p.build-detail-row
+ The artifacts will be removed in
+ %span.js-artifacts-remove
+ 2016-12-19 09:02:12 UTC