fix: harden token and URL handling

* fix: harden token and URL handling

* test: restore full web test suite

---------

Co-authored-by: batumilove <batumilove@users.noreply.github.com>
This commit is contained in:
batumilove
2026-05-28 05:31:46 +04:00
committed by Offending Commit
parent 6960bf4ffe
commit 5cfbae6248
11 changed files with 152 additions and 14 deletions

View File

@@ -2,10 +2,8 @@ import "@testing-library/jest-dom/vitest";
import { cleanup } from "@testing-library/react";
import { afterEach, vi } from "vitest";
// jsdom doesn't implement matchMedia; theme code reads it on mount.
if (!window.scrollTo) {
window.scrollTo = vi.fn() as unknown as typeof window.scrollTo;
}
// jsdom defines scrollTo but leaves it unimplemented; router scroll restoration calls it.
window.scrollTo = vi.fn() as unknown as typeof window.scrollTo;
if (!window.matchMedia) {
window.matchMedia = vi.fn().mockImplementation((query: string) => ({