diff --git a/frontend/src/__tests__/esp32-integration.test.ts b/frontend/src/__tests__/esp32-integration.test.ts index c44c36ea..88d79716 100644 --- a/frontend/src/__tests__/esp32-integration.test.ts +++ b/frontend/src/__tests__/esp32-integration.test.ts @@ -46,6 +46,7 @@ vi.mock('../simulation/PinManager', () => ({ this.updatePort = vi.fn(); this.onPinChange = vi.fn().mockReturnValue(() => {}); this.getListenersCount = vi.fn().mockReturnValue(0); + this.resetPinStates = vi.fn(); }), })); diff --git a/frontend/src/__tests__/esp32c3-blink.test.ts b/frontend/src/__tests__/esp32c3-blink.test.ts index 031e74d7..7838e4f9 100644 --- a/frontend/src/__tests__/esp32c3-blink.test.ts +++ b/frontend/src/__tests__/esp32c3-blink.test.ts @@ -158,9 +158,11 @@ describe('ESP32-C3 bare-metal blink (compiled with riscv32-esp-elf-gcc)', () => sim.loadBin(binData); runSteps(sim, 2000); - // PinManager must have received GPIO 8 state changes - expect(pm.setPinState).toHaveBeenCalledWith(8, true); - expect(pm.setPinState).toHaveBeenCalledWith(8, false); + // PinManager must have received GPIO 8 state changes. Production code + // passes the optional `source` argument ('mcu') since PinManager added + // the input/output classification field. + expect(pm.setPinState).toHaveBeenCalledWith(8, true, 'mcu'); + expect(pm.setPinState).toHaveBeenCalledWith(8, false, 'mcu'); }); it('timestamps increase monotonically across blink events', () => { diff --git a/frontend/src/__tests__/esp32c3-simulation.test.ts b/frontend/src/__tests__/esp32c3-simulation.test.ts index 6d8ebc48..7b06abf2 100644 --- a/frontend/src/__tests__/esp32c3-simulation.test.ts +++ b/frontend/src/__tests__/esp32c3-simulation.test.ts @@ -480,7 +480,7 @@ describe('Esp32C3Simulator — GPIO pin toggling', () => { core.reset(0x42000000); runSteps(core, 3); - expect(pm.setPinState).toHaveBeenCalledWith(0, true); + expect(pm.setPinState).toHaveBeenCalledWith(0, true, 'mcu'); s.stop(); }); }); diff --git a/frontend/src/__tests__/multi-board-integration.test.ts b/frontend/src/__tests__/multi-board-integration.test.ts index 32bea691..42e26c1b 100644 --- a/frontend/src/__tests__/multi-board-integration.test.ts +++ b/frontend/src/__tests__/multi-board-integration.test.ts @@ -48,6 +48,7 @@ vi.mock('../simulation/PinManager', () => ({ this.updatePort = vi.fn(); this.onPinChange = vi.fn().mockReturnValue(() => {}); this.getListenersCount = vi.fn().mockReturnValue(0); + this.resetPinStates = vi.fn(); }), }));