summaryrefslogtreecommitdiff
path: root/spec/frontend/deploy_freeze/helpers.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/deploy_freeze/helpers.js')
-rw-r--r--spec/frontend/deploy_freeze/helpers.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/frontend/deploy_freeze/helpers.js b/spec/frontend/deploy_freeze/helpers.js
new file mode 100644
index 00000000000..bfb84142662
--- /dev/null
+++ b/spec/frontend/deploy_freeze/helpers.js
@@ -0,0 +1,9 @@
+import { secondsToHours } from '~/lib/utils/datetime_utility';
+
+export const freezePeriodsFixture = getJSONFixture('/api/freeze-periods/freeze_periods.json');
+export const timezoneDataFixture = getJSONFixture('/api/freeze-periods/timezone_data.json');
+
+export const findTzByName = (identifier = '') =>
+ timezoneDataFixture.find(({ name }) => name.toLowerCase() === identifier.toLowerCase());
+
+export const formatTz = ({ offset, name }) => `[UTC ${secondsToHours(offset)}] ${name}`;