diff options
Diffstat (limited to 'spec/frontend/deploy_freeze/store')
-rw-r--r-- | spec/frontend/deploy_freeze/store/actions_spec.js | 3 | ||||
-rw-r--r-- | spec/frontend/deploy_freeze/store/mutations_spec.js | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/spec/frontend/deploy_freeze/store/actions_spec.js b/spec/frontend/deploy_freeze/store/actions_spec.js index 97f94cdbf5e..3c9d25c4f5c 100644 --- a/spec/frontend/deploy_freeze/store/actions_spec.js +++ b/spec/frontend/deploy_freeze/store/actions_spec.js @@ -6,6 +6,7 @@ import { deprecatedCreateFlash as createFlash } from '~/flash'; import getInitialState from '~/deploy_freeze/store/state'; import * as actions from '~/deploy_freeze/store/actions'; import * as types from '~/deploy_freeze/store/mutation_types'; +import { freezePeriodsFixture, timezoneDataFixture } from '../helpers'; jest.mock('~/api.js'); jest.mock('~/flash.js'); @@ -13,8 +14,6 @@ jest.mock('~/flash.js'); describe('deploy freeze store actions', () => { let mock; let state; - const freezePeriodsFixture = getJSONFixture('/api/freeze-periods/freeze_periods.json'); - const timezoneDataFixture = getJSONFixture('/api/freeze-periods/timezone_data.json'); beforeEach(() => { mock = new MockAdapter(axios); diff --git a/spec/frontend/deploy_freeze/store/mutations_spec.js b/spec/frontend/deploy_freeze/store/mutations_spec.js index 0453e037e15..7cb208f16b2 100644 --- a/spec/frontend/deploy_freeze/store/mutations_spec.js +++ b/spec/frontend/deploy_freeze/store/mutations_spec.js @@ -2,10 +2,10 @@ import state from '~/deploy_freeze/store/state'; import mutations from '~/deploy_freeze/store/mutations'; import * as types from '~/deploy_freeze/store/mutation_types'; import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; +import { findTzByName, formatTz, freezePeriodsFixture, timezoneDataFixture } from '../helpers'; describe('Deploy freeze mutations', () => { let stateCopy; - const timezoneDataFixture = getJSONFixture('/api/freeze-periods/timezone_data.json'); beforeEach(() => { stateCopy = state({ @@ -28,7 +28,6 @@ describe('Deploy freeze mutations', () => { describe('RECEIVE_FREEZE_PERIODS_SUCCESS', () => { it('should set freeze periods and format timezones from identifiers to names', () => { const timezoneNames = ['Berlin', 'UTC', 'Eastern Time (US & Canada)']; - const freezePeriodsFixture = getJSONFixture('/api/freeze-periods/freeze_periods.json'); mutations[types.RECEIVE_FREEZE_PERIODS_SUCCESS](stateCopy, freezePeriodsFixture); @@ -43,9 +42,10 @@ describe('Deploy freeze mutations', () => { describe('SET_SELECTED_TIMEZONE', () => { it('should set the cron timezone', () => { + const selectedTz = findTzByName('Pacific Time (US & Canada)'); const timezone = { - formattedTimezone: '[UTC -7] Pacific Time (US & Canada)', - identifier: 'America/Los_Angeles', + formattedTimezone: formatTz(selectedTz), + identifier: selectedTz.identifier, }; mutations[types.SET_SELECTED_TIMEZONE](stateCopy, timezone); |