Skip to content

Commit

Permalink
update tests with getPermitTypeName function
Browse files Browse the repository at this point in the history
  • Loading branch information
glen-aot committed Oct 11, 2024
1 parent 55c0482 commit bb1893b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { permitTypeDisplayText } from "../../../types/PermitType";
import { getPermitTypeName } from "../../../types/PermitType";
import {
DATE_FORMATS,
dayjsToLocalStr,
Expand Down Expand Up @@ -57,7 +57,7 @@ describe("Application Details Display", () => {
);

// Assert
expect(await title()).toHaveTextContent(permitTypeDisplayText(permitType));
expect(await title()).toHaveTextContent(getPermitTypeName(permitType));
expect(await applicationNumber()).toHaveTextContent(
defaultApplicationNumber,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { vehicleTypeDisplayText } from "../../../helpers/mappers";
import { VehicleType } from "../../../../manageVehicles/types/Vehicle";
import { getDefaultRequiredVal } from "../../../../../common/helpers/util";
import { calculateFeeByDuration } from "../../../helpers/feeSummary";
import { permitTypeDisplayText } from "../../../types/PermitType";
import { getPermitTypeName } from "../../../types/PermitType";
import {
DATE_FORMATS,
dayjsToLocalStr,
Expand Down Expand Up @@ -87,7 +87,7 @@ beforeAll(() => {
// @ts-ignore
window.scrollTo = vi.fn();
listenToMockServer();
sessionStorage.setItem('onRouteBC.user.companyId', "74");
sessionStorage.setItem("onRouteBC.user.companyId", "74");
});

beforeEach(() => {
Expand Down Expand Up @@ -120,7 +120,7 @@ describe("Review and Confirm Application Details", () => {
permitType,
} = defaultApplicationData;
expect(await applicationHeaderTitle()).toHaveTextContent(
permitTypeDisplayText(permitType),
getPermitTypeName(permitType),
);
expect(await applicationNumber()).toHaveTextContent(
applicationNo as string,
Expand Down Expand Up @@ -343,7 +343,8 @@ describe("Review and Confirm Application Details", () => {
provinceCode,
vehicleType,
vehicleSubType,
} = defaultApplicationData.permitData.vehicleDetails as PermitVehicleDetails;
} = defaultApplicationData.permitData
.vehicleDetails as PermitVehicleDetails;
const unit = getDefaultRequiredVal("", unitNumber);
const country = formatCountry(countryCode);
const province = formatProvince(countryCode, provinceCode);
Expand Down Expand Up @@ -415,7 +416,9 @@ describe("Review and Confirm Application Details", () => {
defaultApplicationData.permitType,
defaultApplicationData.permitData.permitDuration,
)}`;
const permitTypeStr = permitTypeDisplayText(defaultApplicationData.permitType);
const permitTypeStr = getPermitTypeName(
defaultApplicationData.permitType,
);
expect(await feeSummaryPermitType()).toHaveTextContent(permitTypeStr);
expect(await feeSummaryPrice()).toHaveTextContent(`$${feeSummary}.00`);
expect(await feeSummaryTotal()).toHaveTextContent(`$${feeSummary}.00`);
Expand Down

0 comments on commit bb1893b

Please sign in to comment.