Extend Self-Serve Studio with vehicle type management, mutation options, and enhanced simulation/debug tools. Update OpenAPI, UI components, and related E2E/unit tests.
This commit is contained in:
@@ -159,4 +159,66 @@ describe("useWashSessionActions property gate commands", () => {
|
||||
|
||||
consoleErrorSpy.mockRestore();
|
||||
});
|
||||
|
||||
it("does not duplicate action alerts when allowed-service setup fails before start", async () => {
|
||||
const consoleErrorSpy = vi.spyOn(console, "error").mockImplementation(() => {});
|
||||
const washInProgress = ref(false);
|
||||
const washLaneId = ref(null);
|
||||
const washStartTime = ref(null);
|
||||
const currentStep = ref(2);
|
||||
const updateLaneAllowedServices = vi.fn(async () => {
|
||||
throw new Error("Edge gateway command timed out");
|
||||
});
|
||||
|
||||
const { actions, request, alertFn } = createActions({
|
||||
updateLaneAllowedServices,
|
||||
washInProgress,
|
||||
washLaneId,
|
||||
washStartTime,
|
||||
currentStep,
|
||||
});
|
||||
|
||||
const result = await actions.onStartWash(7, "ab12345", 12345679, 4);
|
||||
|
||||
expect(result).toBe(false);
|
||||
expect(updateLaneAllowedServices).toHaveBeenCalledWith(7);
|
||||
expect(request).not.toHaveBeenCalled();
|
||||
expect(alertFn).not.toHaveBeenCalled();
|
||||
expect(washInProgress.value).toBe(false);
|
||||
expect(currentStep.value).toBe(2);
|
||||
|
||||
consoleErrorSpy.mockRestore();
|
||||
});
|
||||
|
||||
it("keeps the wash started when the post-start machine relay retry fails", async () => {
|
||||
const consoleErrorSpy = vi.spyOn(console, "error").mockImplementation(() => {});
|
||||
const washInProgress = ref(false);
|
||||
const washLaneId = ref(null);
|
||||
const washStartTime = ref(null);
|
||||
const currentStep = ref(2);
|
||||
const enableMachineRelay = vi.fn(async () => {
|
||||
throw new Error("Edge gateway command timed out");
|
||||
});
|
||||
|
||||
const { actions, alertFn } = createActions({
|
||||
washInProgress,
|
||||
washLaneId,
|
||||
washStartTime,
|
||||
currentStep,
|
||||
radioWashType: ref("Machine"),
|
||||
enableMachineRelay,
|
||||
isServiceAllowed: vi.fn(() => true),
|
||||
});
|
||||
|
||||
const result = await actions.onStartWash(7, "ab12345", 12345679, 4);
|
||||
|
||||
expect(result).toBe(true);
|
||||
expect(washInProgress.value).toBe(true);
|
||||
expect(washLaneId.value).toBe(7);
|
||||
expect(currentStep.value).toBe(4);
|
||||
expect(enableMachineRelay).toHaveBeenCalledWith(7);
|
||||
expect(alertFn).not.toHaveBeenCalled();
|
||||
|
||||
consoleErrorSpy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user