From 075590ed39f4c42102f0e6b2ae3b258822945701 Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 17 Aug 2026 06:21:00 +0000 Subject: [PATCH] test: drive the Settings screen in a browser and guard every popup element id (closes #229) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nothing exercised the Settings view in a browser, and jest runs in the node environment with no DOM, so the densest run of $("...") lookups in the codebase was unverified at runtime. A wrong id is valid JavaScript naming a defined function: $() returns null and the next property access throws, which inside a view's init() aborts the rest of the popup's init() and leaves every screen blank. Two halves, because they catch different things. The e2e suite (tests/e2e/run.js) gains seven cases between the address removal and dust threshold sections. They assert the About well and the wallet list were actually written — show() populates those near its end, only the debug well and the debug-mode checkbox follow, so reading them back proves show() ran through to there rather than just far enough to unhide the section — that the four Token Spam Protection controls are real input[type=checkbox] elements defaulted on, and that the theme and network selectors offer exactly the choices src/shared/networks.js and index.html define. What the selectors persist is asserted by a round trip through NON-DEFAULT values: they are driven to dark and sepolia, the popup is closed and reopened, both are read back, and both are then restored the same way and reasserted after a second reopen. Neither value is the first