Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/cycle_analytics/utils_spec.js')
-rw-r--r--spec/frontend/cycle_analytics/utils_spec.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/frontend/cycle_analytics/utils_spec.js b/spec/frontend/cycle_analytics/utils_spec.js
index 15137bb0571..1fecdfc0539 100644
--- a/spec/frontend/cycle_analytics/utils_spec.js
+++ b/spec/frontend/cycle_analytics/utils_spec.js
@@ -1,3 +1,4 @@
+import { useFakeDate } from 'helpers/fake_date';
import {
decorateEvents,
decorateData,
@@ -6,6 +7,7 @@ import {
medianTimeToParsedSeconds,
formatMedianValues,
filterStagesByHiddenStatus,
+ calculateFormattedDayInPast,
} from '~/cycle_analytics/utils';
import {
selectedStage,
@@ -149,4 +151,12 @@ describe('Value stream analytics utils', () => {
expect(filterStagesByHiddenStatus(mockStages, isHidden)).toEqual(result);
});
});
+
+ describe('calculateFormattedDayInPast', () => {
+ useFakeDate(1815, 11, 10);
+
+ it('will return 2 dates, now and past', () => {
+ expect(calculateFormattedDayInPast(5)).toEqual({ now: '1815-12-10', past: '1815-12-05' });
+ });
+ });
});