Closed JunTaoLuo closed 4 weeks ago
One open question is where should the test utilities (e.g. mocks, helpers) be located? If it is placed in the same directory as the source and unit test files, it becomes a little more difficult to differentiate between source files and test utilities. We need to test this out to ensure the coverage tool recognizes test utilities correctly.
Update: we decided to keep test utilities in the top level test directory.
cc @simiadebowale @vbahinwillit
Hey team! Please add your planning poker estimate with Zenhub @cferris32 @jenniemc @JunTaoLuo @ryanshaw @simiadebowale @vbahinwillit
All tests are passing locally and on the CI. The coverage remained the same as well:
The only remaining item is to move one last test which will be completed in https://github.com/department-of-veterans-affairs/va.gov-team/issues/95332.
Since this is a test only change, there's no further validation needed.
As part of the effort to improve our unit tests, we've decided to move unit tests to the same directory as the source file of the system under testing.
For example:
Primarily, this provides the benefit of making it easier to find the associated test file for each component and to identify which source files is missing associated tests.
Note that naming of the unit tests should:
.unit.spec.js
as specified here.We'll likely do this in smaller steps, note that some of these tests will have been removed as part of the remove obsolete components work.
[x] 1.
[x] 2.
./src/applications/vaos/tests/new-appointment/components/ClinicChoicePage.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/ClosestCityStatePage.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/CommunityCareLanguagePage.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/CommunityCareProviderSelectionPage/ProviderSortVariant.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/CommunityCareProviderSelectionPage/index.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/ConfirmationPage/ConfirmationDirectScheduleInfoV2.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/ContactInfoPage.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/DateTimeRequestPage/index.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/DateTimeSelectPage/index.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/PreferredDatePage.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/ReasonForAppointmentPage.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/ReviewPage/ContactDetailSection.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/ReviewPage/index.cc-request.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/ReviewPage/index.direct.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/ReviewPage/index.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/ReviewPage/index.va-request.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/ScheduleCernerPage.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/TypeOfAudiologyCare.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/TypeOfEyeCarePage.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/TypeOfFacilityPage.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/TypeOfSleepCarePage.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/TypeOfVisitPage.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/VAFacilityPage/index.eligibility.unit.spec.js ./src/applications/vaos/tests/new-appointment/components/VAFacilityPage/index.unit.spec.js ./src/applications/vaos/tests/new-appointment/newAppointmentFlow.unit.spec.js ./src/applications/vaos/tests/new-appointment/redux/actions.unit.spec.js ./src/applications/vaos/tests/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js ./src/applications/vaos/tests/new-appointment/redux/helpers/formSubmitTransformers.v2.unit.spec.js ./src/applications/vaos/appointment-list/components/PastAppointmentsList/tests/PastAppointmentsDateDropdown.unit.spec.js ./src/applications/vaos/services/appointment/tests/transformers.unit.spec.js
./src/applications/vaos/tests/covid-19-vaccine/components/ClinicChoicePage.unit.spec.js ./src/applications/vaos/tests/covid-19-vaccine/components/ConfirmationPage.unit.spec.js ./src/applications/vaos/tests/covid-19-vaccine/components/ConfirmationPageV2.unit.spec.js ./src/applications/vaos/tests/covid-19-vaccine/components/ContactFacilitiesPage.unit.spec.js ./src/applications/vaos/tests/covid-19-vaccine/components/ContactInfoPage.unit.spec.js ./src/applications/vaos/tests/covid-19-vaccine/components/NewBookingPage.unit.spec.js ./src/applications/vaos/tests/covid-19-vaccine/components/PlanAheadPage.unit.spec.js ./src/applications/vaos/tests/covid-19-vaccine/components/ReceivedDoseScreenerPage.unit.spec.js ./src/applications/vaos/tests/covid-19-vaccine/components/ReviewPage.unit.spec.js ./src/applications/vaos/tests/covid-19-vaccine/components/SecondDosePage.unit.spec.js ./src/applications/vaos/tests/covid-19-vaccine/components/SelectDate1Page.unit.spec.js ./src/applications/vaos/tests/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js ./src/applications/vaos/tests/referral-appointments/ChooseDateAndTime.unit.spec.js ./src/applications/vaos/tests/referral-appointments/components/ReferralReview.unit.spec.js ./src/applications/vaos/tests/services/appointment/index.unit.spec.js ./src/applications/vaos/tests/services/healthcare-service/index.unit.spec.js ./src/applications/vaos/tests/services/location/index.unit.spec.js ./src/applications/vaos/tests/services/mocks/index.unit.spec.js ./src/applications/vaos/tests/services/slot/index.unit.spec.js ./src/applications/vaos/tests/services/utils.unit.spec.js ./src/applications/vaos/tests/services/vaos/index.unit.spec.js ./src/applications/vaos/tests/utils/appointment.unit.spec.js ./src/applications/vaos/tests/utils/error.unit.spec.js ./src/applications/vaos/tests/utils/formatters.unit.spec.js ./src/applications/vaos/tests/utils/timezone.unit.spec.js
./src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/tests/AtlasLocation.unit.spec.js ./src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/tests/CCInstructions.unit.spec.js ./src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/tests/CancelLink.unit.spec.js ./src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/tests/DetailsVA.unit.spec.js ./src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/tests/DetailsVA.util.unit.spec.js ./src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/tests/NoOnlineCancelAlert.unit.spec.js ./src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/tests/PrintButton.unit.spec.js ./src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/tests/PrintLink.unit.spec.js ./src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/tests/ProviderName.unit.spec.js ./src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/tests/StatusAlert.unit.spec.js ./src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/tests/TypeHeader.unit.spec.js ./src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/tests/VAInstructions.unit.spec.js ./src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/tests/VideoInstructionsLink.unit.spec.js ./src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/tests/VideoLink.unit.spec.js ./src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/tests/VideoVisitInstructions.unit.spec.js ./src/applications/vaos/appointment-list/components/PastAppointmentsList/tests/PastAppointmentsDateDropdown.unit.spec.js ./src/applications/vaos/appointment-list/components/tests/AppointmentColumn.unit.spec.js ./src/applications/vaos/appointment-list/components/tests/AppointmentRow.unit.spec.js ./src/applications/vaos/appointment-list/components/tests/NoAppointments.unit.spec.js ./src/applications/vaos/appointment-list/hooks/tests/use-handle-click.unit.spec.js ./src/applications/vaos/appointment-list/hooks/tests/use-handle-key-down.unit.spec.js ./src/applications/vaos/appointment-list/redux/tests/selectors.unit.spec.js ./src/applications/vaos/appointment-list/tests/index.unit.spec.js
./src/applications/vaos/components/tests/AfterVisitSummary.unit.spec.js ./src/applications/vaos/components/tests/AppointmentCard.unit.spec.js ./src/applications/vaos/components/tests/AppointmentCardIcon.unit.spec.js ./src/applications/vaos/components/tests/CCLayout.unit.spec.js ./src/applications/vaos/components/tests/CCRequestLayout.unit.spec.js ./src/applications/vaos/components/tests/ClaimExamLayout.unit.spec.js ./src/applications/vaos/components/tests/InPersonLayout.unit.spec.js ./src/applications/vaos/components/tests/PhoneLayout.unit.spec.js ./src/applications/vaos/components/tests/VARequestLayout.unit.spec.js ./src/applications/vaos/components/tests/VideoInstructions.unit.spec.js ./src/applications/vaos/components/tests/VideoLayout.unit.spec.js ./src/applications/vaos/components/tests/VideoLayoutAtlas.unit.spec.js ./src/applications/vaos/components/tests/VideoLayoutVA.unit.spec.js ./src/applications/vaos/components/tests/VideoLink.unit.spec.js ./src/applications/vaos/services/appointment/tests/transformers.unit.spec.js
./src/applications/vaos/tests/new-appointment/components/TypeOfCarePage.unit.spec.js