Commit 78e34d8a authored by Alfredo Sumaran's avatar Alfredo Sumaran

Merge branch 'fix-Build-timeFor' into 'master'

Fix typo in Build page JavaScript

## What does this MR do?

fixes #24614

See merge request !7563
parents 461d709c 6c67f4ab
......@@ -172,7 +172,7 @@
$date = $('.js-artifacts-remove');
if ($date.length) {
date = $date.text();
return $date.text(gl.utils.timefor(new Date(date.replace(/([0-9]+)-([0-9]+)-([0-9]+)/g, '$1/$2/$3')), ' '));
return $date.text(gl.utils.timeFor(new Date(date.replace(/([0-9]+)-([0-9]+)-([0-9]+)/g, '$1/$2/$3')), ' '));
}
};
......
---
title: Fix typo in Build page JavaScript
merge_request: 7563
author: winniehell
/* 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 () {
......
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment