diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-11-19 07:20:18 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-11-19 07:20:18 +0300 |
commit | 78e34d8add4bc1d5e4d820a3a8e8636d5226c427 (patch) | |
tree | c2230affa091f1d2af56e46d5292f1ab75f75a22 /spec | |
parent | 461d709c87cc1b83d36539ccd16f279d6e12b89f (diff) | |
parent | 6c67f4abfe3bb88c0cc5b795e58fd6fc22561359 (diff) |
Merge branch 'fix-Build-timeFor' into 'master'
Fix typo in Build page JavaScript
## What does this MR do?
fixes #24614
See merge request !7563
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/build_spec.js.es6 | 15 | ||||
-rw-r--r-- | spec/javascripts/fixtures/build.html.haml | 5 |
2 files changed, 20 insertions, 0 deletions
diff --git a/spec/javascripts/build_spec.js.es6 b/spec/javascripts/build_spec.js.es6 index 370944b6a8c..e21e5844a26 100644 --- a/spec/javascripts/build_spec.js.es6 +++ b/spec/javascripts/build_spec.js.es6 @@ -1,5 +1,7 @@ /* global Build */ /* eslint-disable no-new */ +//= require lib/utils/timeago +//= require lib/utils/datetime_utility //= require build //= require breakpoints //= require jquery.nicescroll @@ -24,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(); }); @@ -54,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 |