Commit ab6b2a54 authored by Albert Salim's avatar Albert Salim

Use import for JSON fixtures

- ee/spec/frontend/on_demand_scans_form
- ee/spec/frontend/oncall_schedule
- ee/spec/frontend/security_configuration
parent d6fb5dd9
import { GlDatepicker, GlFormCheckbox, GlFormGroup } from '@gitlab/ui'; import { GlDatepicker, GlFormCheckbox, GlFormGroup } from '@gitlab/ui';
import { merge } from 'lodash'; import { merge } from 'lodash';
import mockTimezones from 'test_fixtures/timezones/full.json';
import ScanSchedule from 'ee/on_demand_scans_form/components/scan_schedule.vue'; import ScanSchedule from 'ee/on_demand_scans_form/components/scan_schedule.vue';
import { SCAN_CADENCE_OPTIONS } from 'ee/on_demand_scans_form/settings'; import { SCAN_CADENCE_OPTIONS } from 'ee/on_demand_scans_form/settings';
import DropdownInput from 'ee/security_configuration/components/dropdown_input.vue'; import DropdownInput from 'ee/security_configuration/components/dropdown_input.vue';
...@@ -7,7 +8,6 @@ import { stubComponent } from 'helpers/stub_component'; ...@@ -7,7 +8,6 @@ import { stubComponent } from 'helpers/stub_component';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import TimezoneDropdown from '~/vue_shared/components/timezone_dropdown.vue'; import TimezoneDropdown from '~/vue_shared/components/timezone_dropdown.vue';
const mockTimezones = getJSONFixture('timezones/full.json');
const timezoneSST = mockTimezones[2]; const timezoneSST = mockTimezones[2];
describe('ScanSchedule', () => { describe('ScanSchedule', () => {
......
import { GlSearchBoxByType, GlDropdown, GlDropdownItem, GlFormGroup } from '@gitlab/ui'; import { GlSearchBoxByType, GlDropdown, GlDropdownItem, GlFormGroup } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import mockTimezones from 'test_fixtures/timezones/full.json';
import AddEditScheduleForm, { import AddEditScheduleForm, {
i18n, i18n,
} from 'ee/oncall_schedules/components/add_edit_schedule_form.vue'; } from 'ee/oncall_schedules/components/add_edit_schedule_form.vue';
import { stubComponent } from 'helpers/stub_component'; import { stubComponent } from 'helpers/stub_component';
import { getOncallSchedulesQueryResponse } from './mocks/apollo_mock'; import { getOncallSchedulesQueryResponse } from './mocks/apollo_mock';
const mockTimezones = getJSONFixture('timezones/full.json');
describe('AddEditScheduleForm', () => { describe('AddEditScheduleForm', () => {
let wrapper; let wrapper;
const projectPath = 'group/project'; const projectPath = 'group/project';
......
...@@ -2,6 +2,7 @@ import { GlModal, GlAlert } from '@gitlab/ui'; ...@@ -2,6 +2,7 @@ import { GlModal, GlAlert } from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { createLocalVue, shallowMount } from '@vue/test-utils';
import { nextTick } from 'vue'; import { nextTick } from 'vue';
import VueApollo from 'vue-apollo'; import VueApollo from 'vue-apollo';
import mockTimezones from 'test_fixtures/timezones/full.json';
import AddEditScheduleForm from 'ee/oncall_schedules/components/add_edit_schedule_form.vue'; import AddEditScheduleForm from 'ee/oncall_schedules/components/add_edit_schedule_form.vue';
import AddEditScheduleModal, { import AddEditScheduleModal, {
i18n, i18n,
...@@ -19,8 +20,6 @@ import { ...@@ -19,8 +20,6 @@ import {
updateScheduleResponseWithErrors, updateScheduleResponseWithErrors,
} from './mocks/apollo_mock'; } from './mocks/apollo_mock';
const mockTimezones = getJSONFixture('timezones/full.json');
describe('AddScheduleModal', () => { describe('AddScheduleModal', () => {
let wrapper; let wrapper;
let fakeApollo; let fakeApollo;
......
import mockTimezones from 'test_fixtures/timezones/full.json';
import { import {
getFormattedTimezone, getFormattedTimezone,
getParticipantsForSave, getParticipantsForSave,
...@@ -8,8 +9,6 @@ import { ...@@ -8,8 +9,6 @@ import {
} from 'ee/oncall_schedules/utils/common_utils'; } from 'ee/oncall_schedules/utils/common_utils';
import * as ColorUtils from '~/lib/utils/color_utils'; import * as ColorUtils from '~/lib/utils/color_utils';
const mockTimezones = getJSONFixture('timezones/full.json');
describe('getFormattedTimezone', () => { describe('getFormattedTimezone', () => {
it('formats the timezone', () => { it('formats the timezone', () => {
const tz = mockTimezones[0]; const tz = mockTimezones[0];
......
...@@ -2,6 +2,7 @@ import { GlButton, GlCard, GlIcon, GlCollapse } from '@gitlab/ui'; ...@@ -2,6 +2,7 @@ import { GlButton, GlCard, GlIcon, GlCollapse } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils'; import { createLocalVue } from '@vue/test-utils';
import { nextTick } from 'vue'; import { nextTick } from 'vue';
import VueApollo from 'vue-apollo'; import VueApollo from 'vue-apollo';
import mockTimezones from 'test_fixtures/timezones/full.json';
import OnCallSchedule, { i18n } from 'ee/oncall_schedules/components/oncall_schedule.vue'; import OnCallSchedule, { i18n } from 'ee/oncall_schedules/components/oncall_schedule.vue';
import RotationsListSection from 'ee/oncall_schedules/components/schedule/components/rotations_list_section.vue'; import RotationsListSection from 'ee/oncall_schedules/components/schedule/components/rotations_list_section.vue';
import ScheduleTimelineSection from 'ee/oncall_schedules/components/schedule/components/schedule_timeline_section.vue'; import ScheduleTimelineSection from 'ee/oncall_schedules/components/schedule/components/schedule_timeline_section.vue';
...@@ -15,8 +16,6 @@ import waitForPromises from 'helpers/wait_for_promises'; ...@@ -15,8 +16,6 @@ import waitForPromises from 'helpers/wait_for_promises';
import * as dateTimeUtility from '~/lib/utils/datetime/date_calculation_utility'; import * as dateTimeUtility from '~/lib/utils/datetime/date_calculation_utility';
import { getOncallSchedulesQueryResponse } from './mocks/apollo_mock'; import { getOncallSchedulesQueryResponse } from './mocks/apollo_mock';
const mockTimezones = getJSONFixture('timezones/full.json');
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(VueApollo); localVue.use(VueApollo);
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import mockTimezones from 'test_fixtures/timezones/full.json';
import DastScanSchedule from 'ee/security_configuration/dast_profiles/components/dast_scan_schedule.vue'; import DastScanSchedule from 'ee/security_configuration/dast_profiles/components/dast_scan_schedule.vue';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
const mockTimezones = getJSONFixture('timezones/full.json');
describe('EE - DastScanSchedule', () => { describe('EE - DastScanSchedule', () => {
let wrapper; let wrapper;
......
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