mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 03:20:46 +02:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user