Commit 0a98a4d5 authored by Simon Knox's avatar Simon Knox

Fix date-dependent snapshot test with useFakeDate

parent f54038fb
import Vuex from 'vuex'; import Vuex from 'vuex';
import { createLocalVue, mount } from '@vue/test-utils'; import { createLocalVue, mount } from '@vue/test-utils';
import { useFakeDate } from 'helpers/fake_date';
import createStore from 'ee/geo_replicable/store'; import createStore from 'ee/geo_replicable/store';
import GeoReplicableTimeAgo from 'ee/geo_replicable/components/geo_replicable_time_ago.vue'; import GeoReplicableTimeAgo from 'ee/geo_replicable/components/geo_replicable_time_ago.vue';
import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue';
...@@ -34,6 +35,9 @@ describe('GeoReplicableTimeAgo', () => { ...@@ -34,6 +35,9 @@ describe('GeoReplicableTimeAgo', () => {
const findDefaultText = () => findGeoReplicableTimeAgo().find('span'); const findDefaultText = () => findGeoReplicableTimeAgo().find('span');
describe('template', () => { describe('template', () => {
// ensure consistent output for timeago
useFakeDate(2020, 0, 1);
beforeEach(() => { beforeEach(() => {
createComponent(); createComponent();
}); });
......
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