]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
test(webui): add comprehensive unit test suite (#1738)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 19 Mar 2026 11:39:02 +0000 (12:39 +0100)
committerGitHub <noreply@github.com>
Thu, 19 Mar 2026 11:39:02 +0000 (12:39 +0100)
commit8e92434ca274469cc8b0643546a9980710dc6bc1
tree741752b439cf59c806a9a005152c7ffa716cad3f
parentfe485a8a839bd82c3aaa45cdc45b7144aa715906
test(webui): add comprehensive unit test suite (#1738)

* test(webui): add test infrastructure and setup

* test(webui): add Utils composable tests

* test(webui): refactor and expand UIClient tests

* test(webui): add action modal component tests

* test(webui): fix JSDoc warnings in mount factory functions

* test(webui): add ChargingStationsView tests

* [autofix.ci] apply automated fixes

* test(webui): finalize coverage and verify quality gates

* test(webui): harmonize test infrastructure — extract ButtonStub, unify toast mock, DRY error tests

* test(webui): add missing coverage for timeout, server switching, authorize errors, WS states

* test(webui): raise coverage thresholds to match achieved 93%/91%/85%/93%

* test(webui): address PR review — unify mock cleanup, improve MockWebSocket fidelity, fix types

* test(webui): adapt tests for new OCPP Version column

* test(webui): remove MockWebSocket auto-open, robustify component lookups, add open assertion

* test(webui): init MockWebSocket readyState to CONNECTING per WebSocket spec

* fix(webui): use window.localStorage for Node 22+ jsdom compatibility

* fix(webui): disable Node 25+ native webstorage to prevent jsdom localStorage conflict

* test(webui): await router.isReady() in App mount test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
15 files changed:
ui/web/tests/setup.ts [new file with mode: 0644]
ui/web/tests/unit/AddChargingStations.test.ts [new file with mode: 0644]
ui/web/tests/unit/CSConnector.test.ts [new file with mode: 0644]
ui/web/tests/unit/CSData.test.ts [new file with mode: 0644]
ui/web/tests/unit/CSTable.test.ts
ui/web/tests/unit/ChargingStationsView.test.ts [new file with mode: 0644]
ui/web/tests/unit/SetSupervisionUrl.test.ts [new file with mode: 0644]
ui/web/tests/unit/SimpleComponents.test.ts [new file with mode: 0644]
ui/web/tests/unit/StartTransaction.test.ts [new file with mode: 0644]
ui/web/tests/unit/ToggleButton.test.ts [new file with mode: 0644]
ui/web/tests/unit/UIClient.test.ts
ui/web/tests/unit/Utils.test.ts [new file with mode: 0644]
ui/web/tests/unit/constants.ts [new file with mode: 0644]
ui/web/tests/unit/helpers.ts [new file with mode: 0644]
ui/web/vitest.config.ts