Merge remote-tracking branch 'origin/release/2025.05.22' into feature/CASH-45
This commit is contained in:
commit
fd077c8507
3 changed files with 45 additions and 18 deletions
|
|
@ -73,22 +73,6 @@ export async function saveSession({
|
|||
if (!store.getters.applicationUser.savedSessionId || shouldAwaitSaveSessionQueue) {
|
||||
await saveSessionPromise;
|
||||
}
|
||||
|
||||
const lineItems = store.getters.order?.lineItems ?? {};
|
||||
const combinedLineItems = [
|
||||
...(lineItems.glassParts || []),
|
||||
...(lineItems.supportingItems || []),
|
||||
...(lineItems.vaps || []),
|
||||
...(lineItems.promos || []),
|
||||
];
|
||||
|
||||
const cashPriceSubtotal = combinedLineItems.length
|
||||
? baseMixin.methods
|
||||
.getTotalPriceOfAllLineItemsAndChildParts(combinedLineItems, false)
|
||||
.toFixed(2)
|
||||
: "";
|
||||
|
||||
store.commit(storeMutations.UPDATE_CASH_PRICE_SUBTOTAL, cashPriceSubtotal);
|
||||
}
|
||||
|
||||
export async function submitWorkOrder({
|
||||
|
|
|
|||
|
|
@ -12,8 +12,30 @@ import baseMixin from "@/mixins/base-mixin.js";
|
|||
import { containsLineItemWithPartType } from "../../helpers/service-package-helper";
|
||||
|
||||
jest.mock("@/store", () => ({
|
||||
commit: jest.fn(),
|
||||
commit: jest.fn(), // Mock store.commit
|
||||
dispatch: jest.fn(),
|
||||
getters: {
|
||||
order: {
|
||||
lineItems: {
|
||||
glassParts: [],
|
||||
supportingItems: [],
|
||||
vaps: [],
|
||||
promos: [],
|
||||
},
|
||||
payment: {
|
||||
insuranceCoverage: {},
|
||||
isInsurance: false,
|
||||
parentAccountNumber: 167132,
|
||||
},
|
||||
},
|
||||
payment: {
|
||||
insuranceCoverage: {},
|
||||
isInsurance: false,
|
||||
},
|
||||
customer: {
|
||||
emailAddress: "test@test.com",
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
// Mock fetchCmsContentForPage
|
||||
|
|
@ -157,6 +179,7 @@ afterEach(() => {
|
|||
describe("quote.vue", () => {
|
||||
test("IsInsurance false should navigateWithSaving", async () => {
|
||||
//Arrange
|
||||
store.commit = jest.fn(); // Ensure store.commit is mocked
|
||||
store.getters.payment = {
|
||||
insuranceCoverage: {},
|
||||
isInsurance: false,
|
||||
|
|
@ -785,6 +808,7 @@ describe("quote.vue", () => {
|
|||
});
|
||||
test("On forward button action save promos", async () => {
|
||||
//Arrange
|
||||
store.commit = jest.fn(); // Ensure store.commit is mocked
|
||||
store.getters.payment = {
|
||||
insuranceCoverage: {},
|
||||
isInsurance: false,
|
||||
|
|
@ -809,7 +833,8 @@ describe("quote.vue", () => {
|
|||
expect(wrapper.vm.lineItems.promos !== null).toBe(true);
|
||||
});
|
||||
test("On forward button action save supporting lineItems", async () => {
|
||||
//Arrange
|
||||
// Arrange
|
||||
store.commit = jest.fn(); // Ensure store.commit is mocked
|
||||
store.getters.payment = {
|
||||
insuranceCoverage: {},
|
||||
isInsurance: false,
|
||||
|
|
@ -820,6 +845,7 @@ describe("quote.vue", () => {
|
|||
parentAccountNumber: 167132,
|
||||
},
|
||||
};
|
||||
|
||||
const { wrapper } = setupMocks({
|
||||
customMountOptions: {
|
||||
router: {
|
||||
|
|
|
|||
|
|
@ -169,6 +169,7 @@ import {
|
|||
import { showFmgLoadingModal } from "@/helpers/loading-modal-helper";
|
||||
import { routeData } from "@/router/constants/routes";
|
||||
import { consumeQueryFromStash } from "@/router/methods/helpers/querystring-stash";
|
||||
import { storeMutations } from "@/constants/store-mutations";
|
||||
|
||||
defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
|
||||
|
||||
|
|
@ -777,6 +778,22 @@ export default {
|
|||
this.pageName
|
||||
);
|
||||
}
|
||||
|
||||
const lineItems = store.getters.order?.lineItems ?? {};
|
||||
const combinedLineItems = [
|
||||
...(lineItems.glassParts || []),
|
||||
...(lineItems.supportingItems || []),
|
||||
...(lineItems.vaps || []),
|
||||
...(lineItems.promos || []),
|
||||
];
|
||||
|
||||
const cashPriceSubtotal = combinedLineItems.length
|
||||
? baseMixin.methods
|
||||
.getTotalPriceOfAllLineItemsAndChildParts(combinedLineItems, false)
|
||||
.toFixed(2)
|
||||
: "";
|
||||
|
||||
store.commit(storeMutations.UPDATE_CASH_PRICE_SUBTOTAL, cashPriceSubtotal);
|
||||
},
|
||||
attachCustomEventsForAnalytics() {
|
||||
this.prependActionToMethod(this, this.forwardButtonAction, () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue