Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f4b248573a | ||
|
|
14e454e9d9 | ||
|
|
ebab7d8804 | ||
|
|
d42b58c4fe | ||
|
|
724ad8e7a1 | ||
|
|
2fe50729a5 | ||
|
|
eb4eee1aef |
@@ -250,16 +250,18 @@ export function useWashSessionActions(options) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const selectedWashType = radioWashType.value === "Machine" ? "Machine" : "Manual";
|
||||
const startResponse = await executeSelfServeCommand(laneId, "START", {
|
||||
customer_number: parseInt(customerNumber),
|
||||
license_plate: licensePlate.trim().toUpperCase(),
|
||||
wash_type: selectedWashType,
|
||||
defer_relay_side_effects: true,
|
||||
});
|
||||
if (!startResponse) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (radioWashType.value === "Machine" && isServiceAllowed("MACHINE")) {
|
||||
if (selectedWashType === "Machine" && isServiceAllowed("MACHINE")) {
|
||||
let machineRelayResponse = null;
|
||||
try {
|
||||
machineRelayResponse = await enableMachineRelay(laneId);
|
||||
|
||||
@@ -512,6 +512,7 @@ test.describe("Self-serve wash", () => {
|
||||
expect(startCommandRequest.postDataJSON?.()).toMatchObject({
|
||||
lane_id: 7,
|
||||
command: "START",
|
||||
wash_type: "Manual",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -778,6 +779,7 @@ test.describe("Self-serve wash", () => {
|
||||
expect(startCommandRequest.postDataJSON?.()).toMatchObject({
|
||||
command: "START",
|
||||
customer_number: 12345679,
|
||||
wash_type: "Manual",
|
||||
defer_relay_side_effects: true,
|
||||
});
|
||||
await page.waitForTimeout(250);
|
||||
|
||||
@@ -47,7 +47,7 @@ describe("useWashSessionActions production commands", () => {
|
||||
expect(state.request).toHaveBeenCalledWith(
|
||||
"/modules/self-serve/lane/command",
|
||||
"post",
|
||||
expect.objectContaining({ command: "START", license_plate: "AB12345" })
|
||||
expect.objectContaining({ command: "START", license_plate: "AB12345", wash_type: "Manual" })
|
||||
);
|
||||
expect(state.washInProgress.value).toBe(true);
|
||||
expect(state.currentStep.value).toBe(WASH_STEPS.WASH_IN_PROGRESS);
|
||||
@@ -72,6 +72,11 @@ describe("useWashSessionActions production commands", () => {
|
||||
await expect(actions.onStartWash(7, "AB12345", "12345679")).resolves.toBe(true);
|
||||
|
||||
expect(state.enableMachineRelay).toHaveBeenCalledWith(7);
|
||||
expect(state.request).toHaveBeenCalledWith(
|
||||
"/modules/self-serve/lane/command",
|
||||
"post",
|
||||
expect.objectContaining({ command: "START", wash_type: "Machine" })
|
||||
);
|
||||
expect(state.washInProgress.value).toBe(true);
|
||||
});
|
||||
|
||||
|
||||
@@ -207,6 +207,7 @@ describe("useWashSessionActions property gate commands", () => {
|
||||
command: "START",
|
||||
customer_number: 12345679,
|
||||
license_plate: "AB12345",
|
||||
wash_type: "Manual",
|
||||
defer_relay_side_effects: true,
|
||||
});
|
||||
|
||||
@@ -286,6 +287,7 @@ describe("useWashSessionActions property gate commands", () => {
|
||||
command: "START",
|
||||
customer_number: 12345679,
|
||||
license_plate: "AB12345",
|
||||
wash_type: "Machine",
|
||||
defer_relay_side_effects: true,
|
||||
});
|
||||
expect(request).toHaveBeenCalledWith("/modules/self-serve/lane/command", "post", {
|
||||
@@ -346,6 +348,7 @@ describe("useWashSessionActions property gate commands", () => {
|
||||
command: "START",
|
||||
customer_number: 12345679,
|
||||
license_plate: "AB12345",
|
||||
wash_type: "Machine",
|
||||
defer_relay_side_effects: true,
|
||||
});
|
||||
expect(request).toHaveBeenCalledWith("/modules/self-serve/lane/command", "post", {
|
||||
|
||||
Reference in New Issue
Block a user