Explicitly test for console warnings & errors (#6502)

# Description of Changes
Disallow warnings and errors from being thrown in the browser console
during tests unless explicitly expected in the test. Also adds a
Playwright test to prod around some main UI areas and checks that no
warnings/errors have been thrown.
This commit is contained in:
James Brunton
2026-06-09 08:34:02 +00:00
committed by GitHub
parent 002de06411
commit 0e3cbb3cf2
28 changed files with 544 additions and 213 deletions
@@ -1,5 +1,6 @@
import { describe, expect, test, beforeEach } from "vitest";
import "fake-indexeddb/auto";
import { expectConsole } from "@app/tests/failOnConsole";
import {
DATABASE_CONFIGS,
@@ -363,6 +364,9 @@ describe("IndexedDB migration (FILES store)", () => {
});
test("SaaS v6 database is force-deleted (data lost, schema reset to v9)", async () => {
// The force-delete warn IS the contract under test; production fires it
// to surface why data was wiped.
expectConsole.warn(/Deleting corrupt SaaS v6/);
await seedSaasDatabase(6, ["v6-corrupt-file"]);
await indexedDBManager.openDatabase(DATABASE_CONFIGS.FILES);
@@ -381,6 +385,9 @@ describe("IndexedDB migration (FILES store)", () => {
});
test("SaaS v7 database is force-deleted (data lost, schema reset to v9)", async () => {
// The force-delete warn IS the contract under test; production fires it
// to surface why data was wiped.
expectConsole.warn(/Deleting corrupt SaaS v7/);
await seedSaasDatabase(7, ["v7-corrupt-file"]);
await indexedDBManager.openDatabase(DATABASE_CONFIGS.FILES);