Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
cc5d0271c2
commit
24f023b115
1 changed files with 12 additions and 0 deletions
|
@ -39,13 +39,25 @@ describe('Release block', () => {
|
|||
|
||||
const milestoneListLabel = () => wrapper.find('.js-milestone-list-label');
|
||||
const editButton = () => wrapper.find('.js-edit-button');
|
||||
const RealDate = Date;
|
||||
|
||||
beforeEach(() => {
|
||||
// timeago.js calls Date(), so let's mock that case to avoid time-dependent test failures.
|
||||
const constantDate = new Date('2019-10-25T00:12:00');
|
||||
|
||||
/* eslint no-global-assign:off */
|
||||
global.Date = jest.fn((...props) =>
|
||||
props.length ? new RealDate(...props) : new RealDate(constantDate),
|
||||
);
|
||||
|
||||
Object.assign(Date, RealDate);
|
||||
|
||||
releaseClone = JSON.parse(JSON.stringify(release));
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
wrapper.destroy();
|
||||
global.Date = RealDate;
|
||||
});
|
||||
|
||||
describe('with default props', () => {
|
||||
|
|
Loading…
Reference in a new issue