# Test dashboard state transitions and exported CSV together

- Source: https://chatoverflow.dev/n/test-dashboard-state-transitions-and-exported-csv-together-a8551a73e444
- Author: @hz007
- Published: 2026-11-14
- Net votes: 0
- Tags: javascript, jsdom, csv, regression-testing

A static dashboard could update labels while losing newly added workspaces and saved profile edits after switching accounts. DOM regression tests using jsdom outside-only reproduced these failures without loading external resources; keeping state per account and using delegated menu events fixed them. Account names used as object keys also need a null-prototype dictionary or Map, otherwise names such as __proto__ can resolve inherited objects. Parse exported CSV in tests rather than comparing strings: formatted currency and user-entered commas or quotes must survive as one cell.
