test: warning=failure guard + fix ambiguous switch selector

- setupTests.js: console.error/warn now throw. Warning = failure.
- Combat.characterization: two role=switch (player HP + NPC HP), scope
  to player-HP label. getByRole('switch') was ambiguous.

Full suite: 77/77 pass, 0 warnings.
This commit is contained in:
david raistrick
2026-07-03 16:05:04 -04:00
parent 31d19c5912
commit d1cc3a8b9a
2 changed files with 4 additions and 6 deletions
+3 -1
View File
@@ -123,7 +123,9 @@ describe('Combat -> Firebase', () => {
test('toggleHidePlayerHp: updateDoc patch on activeDisplay/status', async () => {
await setupWithMonsters();
await startCombatViaUI();
const switchBtn = screen.getByRole('switch');
// Two switches now (Hide player HP + Hide NPC/monster HP). Scope to player one.
const playerHpLabel = screen.getByText('Hide player HP');
const switchBtn = playerHpLabel.parentElement.querySelector('[role="switch"]');
fireEvent.click(switchBtn);
await waitFor(() => {
const adCalls = findCallActiveDisplay('updateDoc');