diff --git a/src/applications/vaos/tests/covid-19-vaccine/components/ClinicChoicePage.unit.spec.js b/src/applications/vaos/covid-19-vaccine/components/ClinicChoicePage.unit.spec.js similarity index 92% rename from src/applications/vaos/tests/covid-19-vaccine/components/ClinicChoicePage.unit.spec.js rename to src/applications/vaos/covid-19-vaccine/components/ClinicChoicePage.unit.spec.js index cc451081c4f6..1c3d7eae4925 100644 --- a/src/applications/vaos/tests/covid-19-vaccine/components/ClinicChoicePage.unit.spec.js +++ b/src/applications/vaos/covid-19-vaccine/components/ClinicChoicePage.unit.spec.js @@ -8,12 +8,12 @@ import { createTestStore, renderWithStoreAndRouter, setVaccineFacility, -} from '../../mocks/setup'; +} from '../../tests/mocks/setup'; -import ClinicChoicePage from '../../../covid-19-vaccine/components/ClinicChoicePage'; -import { TYPE_OF_CARE_ID } from '../../../covid-19-vaccine/utils'; -import { mockEligibilityFetches } from '../../mocks/fetch'; -import { createMockClinic } from '../../mocks/data'; +import ClinicChoicePage from './ClinicChoicePage'; +import { TYPE_OF_CARE_ID } from '../utils'; +import { mockEligibilityFetches } from '../../tests/mocks/fetch'; +import { createMockClinic } from '../../tests/mocks/data'; const initialState = { featureToggles: { diff --git a/src/applications/vaos/tests/covid-19-vaccine/components/ConfirmationPage.unit.spec.js b/src/applications/vaos/covid-19-vaccine/components/ConfirmationPage.unit.spec.js similarity index 95% rename from src/applications/vaos/tests/covid-19-vaccine/components/ConfirmationPage.unit.spec.js rename to src/applications/vaos/covid-19-vaccine/components/ConfirmationPage.unit.spec.js index bb341783944a..382e9cecf268 100644 --- a/src/applications/vaos/tests/covid-19-vaccine/components/ConfirmationPage.unit.spec.js +++ b/src/applications/vaos/covid-19-vaccine/components/ConfirmationPage.unit.spec.js @@ -2,10 +2,13 @@ import { waitFor } from '@testing-library/dom'; import { expect } from 'chai'; import moment from 'moment'; import React from 'react'; -import ConfirmationPage from '../../../covid-19-vaccine/components/ConfirmationPage'; -import { createTestStore, renderWithStoreAndRouter } from '../../mocks/setup'; -import { FETCH_STATUS } from '../../../utils/constants'; -import { getICSTokens } from '../../../utils/calendar'; +import ConfirmationPage from './ConfirmationPage'; +import { + createTestStore, + renderWithStoreAndRouter, +} from '../../tests/mocks/setup'; +import { FETCH_STATUS } from '../../utils/constants'; +import { getICSTokens } from '../../utils/calendar'; const initialState = { featureToggles: { diff --git a/src/applications/vaos/tests/covid-19-vaccine/components/ConfirmationPageV2.unit.spec.js b/src/applications/vaos/covid-19-vaccine/components/ConfirmationPageV2.unit.spec.js similarity index 95% rename from src/applications/vaos/tests/covid-19-vaccine/components/ConfirmationPageV2.unit.spec.js rename to src/applications/vaos/covid-19-vaccine/components/ConfirmationPageV2.unit.spec.js index 57c22b779e67..459f9eab9ac7 100644 --- a/src/applications/vaos/tests/covid-19-vaccine/components/ConfirmationPageV2.unit.spec.js +++ b/src/applications/vaos/covid-19-vaccine/components/ConfirmationPageV2.unit.spec.js @@ -2,10 +2,13 @@ import { waitFor } from '@testing-library/dom'; import { expect } from 'chai'; import moment from 'moment'; import React from 'react'; -import ConfirmationPageV2 from '../../../covid-19-vaccine/components/ConfirmationPageV2'; -import { createTestStore, renderWithStoreAndRouter } from '../../mocks/setup'; -import { FETCH_STATUS } from '../../../utils/constants'; -import { getICSTokens } from '../../../utils/calendar'; +import ConfirmationPageV2 from './ConfirmationPageV2'; +import { + createTestStore, + renderWithStoreAndRouter, +} from '../../tests/mocks/setup'; +import { FETCH_STATUS } from '../../utils/constants'; +import { getICSTokens } from '../../utils/calendar'; const initialState = { featureToggles: { diff --git a/src/applications/vaos/tests/covid-19-vaccine/components/ContactFacilitiesPage.unit.spec.js b/src/applications/vaos/covid-19-vaccine/components/ContactFacilitiesPage.unit.spec.js similarity index 94% rename from src/applications/vaos/tests/covid-19-vaccine/components/ContactFacilitiesPage.unit.spec.js rename to src/applications/vaos/covid-19-vaccine/components/ContactFacilitiesPage.unit.spec.js index f315eaa54897..cd04b46ef9c3 100644 --- a/src/applications/vaos/tests/covid-19-vaccine/components/ContactFacilitiesPage.unit.spec.js +++ b/src/applications/vaos/covid-19-vaccine/components/ContactFacilitiesPage.unit.spec.js @@ -2,12 +2,15 @@ import React from 'react'; import { expect } from 'chai'; import { mockFetch } from '@department-of-veterans-affairs/platform-testing/helpers'; -import ContactFacilitiesPage from '../../../covid-19-vaccine/components/ContactFacilitiesPage'; -import { createTestStore, renderWithStoreAndRouter } from '../../mocks/setup'; -import { createMockFacility } from '../../mocks/data'; -import { mockFacilitiesFetch } from '../../mocks/fetch'; -import { mockSchedulingConfigurations } from '../../mocks/helpers'; -import { getSchedulingConfigurationMock } from '../../mocks/mock'; +import ContactFacilitiesPage from './ContactFacilitiesPage'; +import { + createTestStore, + renderWithStoreAndRouter, +} from '../../tests/mocks/setup'; +import { createMockFacility } from '../../tests/mocks/data'; +import { mockFacilitiesFetch } from '../../tests/mocks/fetch'; +import { mockSchedulingConfigurations } from '../../tests/mocks/helpers'; +import { getSchedulingConfigurationMock } from '../../tests/mocks/mock'; describe('VAOS vaccine flow: ContactFacilitiesPage', () => { const initialState = { diff --git a/src/applications/vaos/tests/covid-19-vaccine/components/ContactInfoPage.unit.spec.js b/src/applications/vaos/covid-19-vaccine/components/ContactInfoPage.unit.spec.js similarity index 96% rename from src/applications/vaos/tests/covid-19-vaccine/components/ContactInfoPage.unit.spec.js rename to src/applications/vaos/covid-19-vaccine/components/ContactInfoPage.unit.spec.js index 9efe833bef8c..887d075d4e5a 100644 --- a/src/applications/vaos/tests/covid-19-vaccine/components/ContactInfoPage.unit.spec.js +++ b/src/applications/vaos/covid-19-vaccine/components/ContactInfoPage.unit.spec.js @@ -3,8 +3,11 @@ import { expect } from 'chai'; import userEvent from '@testing-library/user-event'; import { cleanup } from '@testing-library/react'; -import ContactInfoPage from '../../../covid-19-vaccine/components/ContactInfoPage'; -import { createTestStore, renderWithStoreAndRouter } from '../../mocks/setup'; +import ContactInfoPage from './ContactInfoPage'; +import { + createTestStore, + renderWithStoreAndRouter, +} from '../../tests/mocks/setup'; describe('VAOS Page: ContactInfoPage', () => { it('should submit with valid data', async () => { diff --git a/src/applications/vaos/tests/covid-19-vaccine/components/PlanAheadPage.unit.spec.js b/src/applications/vaos/covid-19-vaccine/components/PlanAheadPage.unit.spec.js similarity index 94% rename from src/applications/vaos/tests/covid-19-vaccine/components/PlanAheadPage.unit.spec.js rename to src/applications/vaos/covid-19-vaccine/components/PlanAheadPage.unit.spec.js index aae9abfc817e..3ccd04a85805 100644 --- a/src/applications/vaos/tests/covid-19-vaccine/components/PlanAheadPage.unit.spec.js +++ b/src/applications/vaos/covid-19-vaccine/components/PlanAheadPage.unit.spec.js @@ -3,8 +3,11 @@ import { expect } from 'chai'; import { waitFor } from '@testing-library/dom'; import userEvent from '@testing-library/user-event'; -import PlanAheadPage from '../../../covid-19-vaccine/components/PlanAheadPage'; -import { createTestStore, renderWithStoreAndRouter } from '../../mocks/setup'; +import PlanAheadPage from './PlanAheadPage'; +import { + createTestStore, + renderWithStoreAndRouter, +} from '../../tests/mocks/setup'; const store = createTestStore(); diff --git a/src/applications/vaos/tests/covid-19-vaccine/components/ReceivedDoseScreenerPage.unit.spec.js b/src/applications/vaos/covid-19-vaccine/components/ReceivedDoseScreenerPage.unit.spec.js similarity index 93% rename from src/applications/vaos/tests/covid-19-vaccine/components/ReceivedDoseScreenerPage.unit.spec.js rename to src/applications/vaos/covid-19-vaccine/components/ReceivedDoseScreenerPage.unit.spec.js index 4ae691d7d4c3..47860e70c4c8 100644 --- a/src/applications/vaos/tests/covid-19-vaccine/components/ReceivedDoseScreenerPage.unit.spec.js +++ b/src/applications/vaos/covid-19-vaccine/components/ReceivedDoseScreenerPage.unit.spec.js @@ -2,9 +2,12 @@ import React from 'react'; import { expect } from 'chai'; import { fireEvent, waitFor } from '@testing-library/dom'; import { cleanup } from '@testing-library/react'; -import { createTestStore, renderWithStoreAndRouter } from '../../mocks/setup'; +import { + createTestStore, + renderWithStoreAndRouter, +} from '../../tests/mocks/setup'; -import ReceivedDoseScreenerPage from '../../../covid-19-vaccine/components/ReceivedDoseScreenerPage'; +import ReceivedDoseScreenerPage from './ReceivedDoseScreenerPage'; const initialState = { featureToggles: { diff --git a/src/applications/vaos/tests/covid-19-vaccine/components/ReviewPage.unit.spec.js b/src/applications/vaos/covid-19-vaccine/components/ReviewPage.unit.spec.js similarity index 95% rename from src/applications/vaos/tests/covid-19-vaccine/components/ReviewPage.unit.spec.js rename to src/applications/vaos/covid-19-vaccine/components/ReviewPage.unit.spec.js index fc1bf40e40c9..42aabc7c199b 100644 --- a/src/applications/vaos/tests/covid-19-vaccine/components/ReviewPage.unit.spec.js +++ b/src/applications/vaos/covid-19-vaccine/components/ReviewPage.unit.spec.js @@ -10,11 +10,14 @@ import { } from '@department-of-veterans-affairs/platform-testing/helpers'; import environment from '@department-of-veterans-affairs/platform-utilities/environment'; -import { createTestStore, renderWithStoreAndRouter } from '../../mocks/setup'; +import { + createTestStore, + renderWithStoreAndRouter, +} from '../../tests/mocks/setup'; -import ReviewPage from '../../../covid-19-vaccine/components/ReviewPage'; -import { onCalendarChange } from '../../../covid-19-vaccine/redux/actions'; -import { mockAppointmentSubmit } from '../../mocks/helpers'; +import ReviewPage from './ReviewPage'; +import { onCalendarChange } from '../redux/actions'; +import { mockAppointmentSubmit } from '../../tests/mocks/helpers'; describe('VAOS vaccine flow: ReviewPage', () => { let store; diff --git a/src/applications/vaos/tests/covid-19-vaccine/components/SecondDosePage.unit.spec.js b/src/applications/vaos/covid-19-vaccine/components/SecondDosePage.unit.spec.js similarity index 94% rename from src/applications/vaos/tests/covid-19-vaccine/components/SecondDosePage.unit.spec.js rename to src/applications/vaos/covid-19-vaccine/components/SecondDosePage.unit.spec.js index 237050f04012..ad77b99d7dc1 100644 --- a/src/applications/vaos/tests/covid-19-vaccine/components/SecondDosePage.unit.spec.js +++ b/src/applications/vaos/covid-19-vaccine/components/SecondDosePage.unit.spec.js @@ -4,9 +4,12 @@ import { expect } from 'chai'; import userEvent from '@testing-library/user-event'; import { waitFor } from '@testing-library/dom'; -import { createTestStore, renderWithStoreAndRouter } from '../../mocks/setup'; +import { + createTestStore, + renderWithStoreAndRouter, +} from '../../tests/mocks/setup'; -import SecondDosePage from '../../../covid-19-vaccine/components/SecondDosePage'; +import SecondDosePage from './SecondDosePage'; const initialState = { featureToggles: { diff --git a/src/applications/vaos/tests/covid-19-vaccine/components/SelectDate1Page.unit.spec.js b/src/applications/vaos/covid-19-vaccine/components/SelectDate1Page.unit.spec.js similarity index 97% rename from src/applications/vaos/tests/covid-19-vaccine/components/SelectDate1Page.unit.spec.js rename to src/applications/vaos/covid-19-vaccine/components/SelectDate1Page.unit.spec.js index 89958037e832..7df104f743c4 100644 --- a/src/applications/vaos/tests/covid-19-vaccine/components/SelectDate1Page.unit.spec.js +++ b/src/applications/vaos/covid-19-vaccine/components/SelectDate1Page.unit.spec.js @@ -10,13 +10,13 @@ import { renderWithStoreAndRouter, setVaccineFacility, setVaccineClinic, -} from '../../mocks/setup'; +} from '../../tests/mocks/setup'; -import SelectDate1Page from '../../../covid-19-vaccine/components/SelectDate1Page'; -import { TYPE_OF_CARE_ID } from '../../../covid-19-vaccine/utils'; -import { mockEligibilityFetches } from '../../mocks/fetch'; -import { createMockClinic } from '../../mocks/data'; -import { mockAppointmentSlotFetch } from '../../mocks/helpers'; +import SelectDate1Page from './SelectDate1Page'; +import { TYPE_OF_CARE_ID } from '../utils'; +import { mockEligibilityFetches } from '../../tests/mocks/fetch'; +import { createMockClinic } from '../../tests/mocks/data'; +import { mockAppointmentSlotFetch } from '../../tests/mocks/helpers'; const initialState = { featureToggles: { diff --git a/src/applications/vaos/tests/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js b/src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js similarity index 98% rename from src/applications/vaos/tests/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js rename to src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js index a2a85c310853..ba69dd52f801 100644 --- a/src/applications/vaos/tests/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js +++ b/src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js @@ -9,22 +9,25 @@ import { import environment from '@department-of-veterans-affairs/platform-utilities/environment'; import { fireEvent, waitFor, within } from '@testing-library/dom'; import { cleanup } from '@testing-library/react'; -import VAFacilityPage from '../../../../covid-19-vaccine/components/VAFacilityPage'; +import VAFacilityPage from '.'; import { createTestStore, renderWithStoreAndRouter, -} from '../../../mocks/setup'; -import { TYPE_OF_CARE_ID } from '../../../../covid-19-vaccine/utils'; -import { createMockClinic, createMockFacility } from '../../../mocks/data'; +} from '../../../tests/mocks/setup'; +import { TYPE_OF_CARE_ID } from '../../utils'; +import { + createMockClinic, + createMockFacility, +} from '../../../tests/mocks/data'; import { mockEligibilityFetches, mockFacilitiesFetch, -} from '../../../mocks/fetch'; +} from '../../../tests/mocks/fetch'; import { mockSchedulingConfigurations, mockGetCurrentPosition, -} from '../../../mocks/helpers'; -import { getSchedulingConfigurationMock } from '../../../mocks/mock'; +} from '../../../tests/mocks/helpers'; +import { getSchedulingConfigurationMock } from '../../../tests/mocks/mock'; const facilityIds = ['983', '983GB', '983GC', '983HK', '983QA', '984']; diff --git a/src/applications/vaos/tests/covid-19-vaccine/components/NewBookingPage.unit.spec.js b/src/applications/vaos/covid-19-vaccine/index.unit.spec.js similarity index 91% rename from src/applications/vaos/tests/covid-19-vaccine/components/NewBookingPage.unit.spec.js rename to src/applications/vaos/covid-19-vaccine/index.unit.spec.js index 90a4be4ecb87..8024c371d0d9 100644 --- a/src/applications/vaos/tests/covid-19-vaccine/components/NewBookingPage.unit.spec.js +++ b/src/applications/vaos/covid-19-vaccine/index.unit.spec.js @@ -6,12 +6,15 @@ import { setFetchJSONResponse, } from '@department-of-veterans-affairs/platform-testing/helpers'; import environment from '@department-of-veterans-affairs/platform-utilities/environment'; -import { createTestStore, renderWithStoreAndRouter } from '../../mocks/setup'; -import { NewBookingSection } from '../../../covid-19-vaccine'; -import { mockFacilitiesFetch } from '../../mocks/fetch'; -import { createMockFacility } from '../../mocks/data'; -import { mockSchedulingConfigurations } from '../../mocks/helpers'; -import { getSchedulingConfigurationMock } from '../../mocks/mock'; +import { + createTestStore, + renderWithStoreAndRouter, +} from '../tests/mocks/setup'; +import { NewBookingSection } from '.'; +import { mockFacilitiesFetch } from '../tests/mocks/fetch'; +import { createMockFacility } from '../tests/mocks/data'; +import { mockSchedulingConfigurations } from '../tests/mocks/helpers'; +import { getSchedulingConfigurationMock } from '../tests/mocks/mock'; const initialState = { featureToggles: { diff --git a/src/applications/vaos/tests/referral-appointments/ChooseDateAndTime.unit.spec.js b/src/applications/vaos/referral-appointments/ChooseDateAndTime.unit.spec.js similarity index 85% rename from src/applications/vaos/tests/referral-appointments/ChooseDateAndTime.unit.spec.js rename to src/applications/vaos/referral-appointments/ChooseDateAndTime.unit.spec.js index ec398b9e656c..395d5c81d81b 100644 --- a/src/applications/vaos/tests/referral-appointments/ChooseDateAndTime.unit.spec.js +++ b/src/applications/vaos/referral-appointments/ChooseDateAndTime.unit.spec.js @@ -2,8 +2,11 @@ import React from 'react'; import { expect } from 'chai'; // import sinon from 'sinon'; import userEvent from '@testing-library/user-event'; -import { createTestStore, renderWithStoreAndRouter } from '../mocks/setup'; -import ChooseDateAndTime from '../../referral-appointments/ChooseDateAndTime'; +import { + createTestStore, + renderWithStoreAndRouter, +} from '../tests/mocks/setup'; +import ChooseDateAndTime from './ChooseDateAndTime'; // Tests skipped for now since there are issues with displaying TZ and redux/data in flux. describe('VAOS referral-appointments', () => { diff --git a/src/applications/vaos/tests/referral-appointments/components/ReferralReview.unit.spec.js b/src/applications/vaos/referral-appointments/ScheduleReferral.unit.spec.js similarity index 82% rename from src/applications/vaos/tests/referral-appointments/components/ReferralReview.unit.spec.js rename to src/applications/vaos/referral-appointments/ScheduleReferral.unit.spec.js index e0c3ebb44c4f..2a84ca10d913 100644 --- a/src/applications/vaos/tests/referral-appointments/components/ReferralReview.unit.spec.js +++ b/src/applications/vaos/referral-appointments/ScheduleReferral.unit.spec.js @@ -1,9 +1,12 @@ import React from 'react'; import { expect } from 'chai'; import sinon from 'sinon'; -import ScheduleReferral from '../../../referral-appointments/ScheduleReferral'; -import { createTestStore, renderWithStoreAndRouter } from '../../mocks/setup'; -import { referral } from '../../../referral-appointments/temp-data/referral'; +import ScheduleReferral from './ScheduleReferral'; +import { + createTestStore, + renderWithStoreAndRouter, +} from '../tests/mocks/setup'; +import { referral } from './temp-data/referral'; describe('scheduleReferral component', () => { it('should display the subtitle correctly given different numbers of appointments', async () => { diff --git a/src/applications/vaos/tests/services/appointment/index.unit.spec.js b/src/applications/vaos/services/appointment/index.unit.spec.js similarity index 98% rename from src/applications/vaos/tests/services/appointment/index.unit.spec.js rename to src/applications/vaos/services/appointment/index.unit.spec.js index 816435c1386a..ce67be1e1b2a 100644 --- a/src/applications/vaos/tests/services/appointment/index.unit.spec.js +++ b/src/applications/vaos/services/appointment/index.unit.spec.js @@ -15,16 +15,19 @@ import { getLongTermAppointmentHistoryV2, isUpcomingAppointmentOrRequest, isValidPastAppointment, -} from '../../../services/appointment'; +} from '.'; import { APPOINTMENT_STATUS, APPOINTMENT_TYPES, VIDEO_TYPES, -} from '../../../utils/constants'; -import moment from '../../../lib/moment-tz'; -import { createMockAppointment } from '../../mocks/data'; -import { getDateRanges, mockVAOSAppointmentsFetch } from '../../mocks/helpers'; -import { generateAppointmentUrl } from '../../../utils/appointment'; +} from '../../utils/constants'; +import moment from '../../lib/moment-tz'; +import { createMockAppointment } from '../../tests/mocks/data'; +import { + getDateRanges, + mockVAOSAppointmentsFetch, +} from '../../tests/mocks/helpers'; +import { generateAppointmentUrl } from '../../utils/appointment'; function setRequestedPeriod(date, amOrPm) { const isAM = amOrPm.toUpperCase() === 'AM'; diff --git a/src/applications/vaos/tests/services/healthcare-service/index.unit.spec.js b/src/applications/vaos/services/healthcare-service/index.unit.spec.js similarity index 95% rename from src/applications/vaos/tests/services/healthcare-service/index.unit.spec.js rename to src/applications/vaos/services/healthcare-service/index.unit.spec.js index fd6fb1d9f83b..42b8132a1f9b 100644 --- a/src/applications/vaos/tests/services/healthcare-service/index.unit.spec.js +++ b/src/applications/vaos/services/healthcare-service/index.unit.spec.js @@ -5,8 +5,8 @@ import { setFetchJSONFailure, } from 'platform/testing/unit/helpers'; -import { getAvailableHealthcareServices } from '../../../services/healthcare-service'; -import mockClinics from '../../../services/mocks/v2/clinics.json'; +import { getAvailableHealthcareServices } from '.'; +import mockClinics from '../mocks/v2/clinics.json'; describe('VAOS Services: Healthcare ', () => { beforeEach(() => { diff --git a/src/applications/vaos/tests/services/location/index.unit.spec.js b/src/applications/vaos/services/location/index.unit.spec.js similarity index 92% rename from src/applications/vaos/tests/services/location/index.unit.spec.js rename to src/applications/vaos/services/location/index.unit.spec.js index 2f796c36703c..80f78f9b56db 100644 --- a/src/applications/vaos/tests/services/location/index.unit.spec.js +++ b/src/applications/vaos/services/location/index.unit.spec.js @@ -11,14 +11,14 @@ import { getLocation, getLocations, getLocationsByTypeOfCareAndSiteIds, -} from '../../../services/location'; -import facilityDetails from '../../../services/mocks/v2/facilities.json'; -import ccProviders from '../../../services/mocks/v2/cc_providers.json'; -import { VHA_FHIR_ID } from '../../../utils/constants'; -import { mockFacilitiesFetch } from '../../mocks/fetch'; -import { createMockFacility } from '../../mocks/data'; -import { mockSchedulingConfigurations } from '../../mocks/helpers'; -import { getSchedulingConfigurationMock } from '../../mocks/mock'; +} from '.'; +import facilityDetails from '../mocks/v2/facilities.json'; +import ccProviders from '../mocks/v2/cc_providers.json'; +import { VHA_FHIR_ID } from '../../utils/constants'; +import { mockFacilitiesFetch } from '../../tests/mocks/fetch'; +import { createMockFacility } from '../../tests/mocks/data'; +import { mockSchedulingConfigurations } from '../../tests/mocks/helpers'; +import { getSchedulingConfigurationMock } from '../../tests/mocks/mock'; describe('VAOS Services: Location ', () => { describe('getLocations', () => { diff --git a/src/applications/vaos/tests/services/mocks/index.unit.spec.js b/src/applications/vaos/services/mocks/index.unit.spec.js similarity index 91% rename from src/applications/vaos/tests/services/mocks/index.unit.spec.js rename to src/applications/vaos/services/mocks/index.unit.spec.js index 2b9df1a22486..bf5742685b54 100644 --- a/src/applications/vaos/tests/services/mocks/index.unit.spec.js +++ b/src/applications/vaos/services/mocks/index.unit.spec.js @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import generateMockSlots from '../../../services/mocks/var/slots'; +import generateMockSlots from './var/slots'; describe('calendar mock data', () => { it('should generate 300 mock slots', () => { diff --git a/src/applications/vaos/tests/services/slot/index.unit.spec.js b/src/applications/vaos/services/slot/index.unit.spec.js similarity index 97% rename from src/applications/vaos/tests/services/slot/index.unit.spec.js rename to src/applications/vaos/services/slot/index.unit.spec.js index b3c25d614316..3b8dc929a1c7 100644 --- a/src/applications/vaos/tests/services/slot/index.unit.spec.js +++ b/src/applications/vaos/services/slot/index.unit.spec.js @@ -6,7 +6,7 @@ import { } from 'platform/testing/unit/helpers'; import moment from 'moment'; -import { getSlots } from '../../../services/slot'; +import { getSlots } from '.'; describe('VAOS Services: Slot ', () => { describe('getSlots', () => { diff --git a/src/applications/vaos/tests/services/utils.unit.spec.js b/src/applications/vaos/services/utils.unit.spec.js similarity index 90% rename from src/applications/vaos/tests/services/utils.unit.spec.js rename to src/applications/vaos/services/utils.unit.spec.js index 831877e5080e..b1dba249501d 100644 --- a/src/applications/vaos/tests/services/utils.unit.spec.js +++ b/src/applications/vaos/services/utils.unit.spec.js @@ -2,8 +2,8 @@ import { expect } from 'chai'; import { mockFetch, setFetchJSONResponse } from 'platform/testing/unit/helpers'; -import { mapToFHIRErrors, fhirSearch } from '../../services/utils'; -import mockData from '../../services/mocks/fhir/mock_organizations.json'; +import { mapToFHIRErrors, fhirSearch } from './utils'; +import mockData from './mocks/fhir/mock_organizations.json'; describe('VAOS Utils: FHIR ', () => { describe('mapToFHIRError', () => { diff --git a/src/applications/vaos/tests/services/vaos/index.unit.spec.js b/src/applications/vaos/services/vaos/index.unit.spec.js similarity index 90% rename from src/applications/vaos/tests/services/vaos/index.unit.spec.js rename to src/applications/vaos/services/vaos/index.unit.spec.js index f7a7cedc7ff0..b742f76cdcf9 100644 --- a/src/applications/vaos/tests/services/vaos/index.unit.spec.js +++ b/src/applications/vaos/services/vaos/index.unit.spec.js @@ -4,8 +4,8 @@ import { setFetchJSONResponse, } from '@department-of-veterans-affairs/platform-testing/helpers'; import environment from '@department-of-veterans-affairs/platform-utilities/environment'; -import { getCommunityCareFacilities } from '../../../services/vaos/index'; -import { calculateBoundingBox } from '../../../utils/address'; +import { getCommunityCareFacilities } from './index'; +import { calculateBoundingBox } from '../../utils/address'; describe('VAOS Services: CC facilities API', () => { beforeEach(() => {}); diff --git a/src/applications/vaos/tests/useFormPageTester.js b/src/applications/vaos/tests/useFormPageTester.js deleted file mode 100644 index 98572d36c53c..000000000000 --- a/src/applications/vaos/tests/useFormPageTester.js +++ /dev/null @@ -1,39 +0,0 @@ -import { useState } from 'react'; -import { getDefaultFormState } from '@department-of-veterans-affairs/react-jsonschema-form/lib/utils'; -import { - updateSchemasAndData, - updateItemsSchema, -} from 'platform/forms-system/src/js/state/helpers'; - -export default function useFormPageTester( - initialData, - openFormPageName = 'openFormPage', -) { - const [dataAndSchema, setDataAndSchema] = useState({ - schema: null, - data: initialData, - }); - - function openFormPage(page, uiSchema, schema) { - const schemaWithItemsCorrected = updateItemsSchema(schema); - setDataAndSchema( - updateSchemasAndData( - schemaWithItemsCorrected, - uiSchema, - getDefaultFormState(schemaWithItemsCorrected, dataAndSchema.data, {}), - ), - ); - } - - function updateFormData(page, uiSchema, data) { - setDataAndSchema( - updateSchemasAndData(dataAndSchema.schema, uiSchema, data), - ); - } - - return { - ...dataAndSchema, - [openFormPageName]: openFormPage, - updateFormData, - }; -} diff --git a/src/applications/vaos/tests/utils/appointment.unit.spec.js b/src/applications/vaos/utils/appointment.unit.spec.js similarity index 84% rename from src/applications/vaos/tests/utils/appointment.unit.spec.js rename to src/applications/vaos/utils/appointment.unit.spec.js index 404c50a0df92..28ebfa05d450 100644 --- a/src/applications/vaos/tests/utils/appointment.unit.spec.js +++ b/src/applications/vaos/utils/appointment.unit.spec.js @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { getRealFacilityId } from '../../utils/appointment'; +import { getRealFacilityId } from './appointment'; describe('VAOS appointment helpers', () => { describe('getRealFacilityId', () => { diff --git a/src/applications/vaos/tests/utils/error.unit.spec.js b/src/applications/vaos/utils/error.unit.spec.js similarity index 87% rename from src/applications/vaos/tests/utils/error.unit.spec.js rename to src/applications/vaos/utils/error.unit.spec.js index 2fcf8606aefe..e9352f864434 100644 --- a/src/applications/vaos/tests/utils/error.unit.spec.js +++ b/src/applications/vaos/utils/error.unit.spec.js @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { getErrorCodes } from '../../utils/error'; +import { getErrorCodes } from './error'; describe('VAOS Utils: getErrorCodes', () => { describe('getErrorCodes', () => { diff --git a/src/applications/vaos/tests/utils/formatters.unit.spec.js b/src/applications/vaos/utils/formatters.unit.spec.js similarity index 94% rename from src/applications/vaos/tests/utils/formatters.unit.spec.js rename to src/applications/vaos/utils/formatters.unit.spec.js index d2f81eb80e5d..a70b03a7f227 100644 --- a/src/applications/vaos/tests/utils/formatters.unit.spec.js +++ b/src/applications/vaos/utils/formatters.unit.spec.js @@ -1,11 +1,6 @@ import { expect } from 'chai'; -import { - titleCase, - sentenceCase, - lowerCase, - aOrAn, -} from '../../utils/formatters'; +import { titleCase, sentenceCase, lowerCase, aOrAn } from './formatters'; describe('VAOS Formatters', () => { describe('titleCase', () => { diff --git a/src/applications/vaos/tests/utils/timezone.unit.spec.js b/src/applications/vaos/utils/timezone.unit.spec.js similarity index 99% rename from src/applications/vaos/tests/utils/timezone.unit.spec.js rename to src/applications/vaos/utils/timezone.unit.spec.js index 29c3ca6199cc..0bece1c94102 100644 --- a/src/applications/vaos/tests/utils/timezone.unit.spec.js +++ b/src/applications/vaos/utils/timezone.unit.spec.js @@ -3,7 +3,7 @@ import { getTimezoneAbbrByFacilityId, getTimezoneNameFromAbbr, stripDST, -} from '../../utils/timezone'; +} from './timezone'; describe('VAOS Utils: timezone', () => { describe('getTimezoneAbbrByFacilityId', () => {