chore(deps-dev): bump msw from 2.15.0 to 3.0.8 and move the client tests to it

msw 3 renames onUnhandledRequest to onUnhandledFrame and reports every
network frame there; the setup judges the HTTP frames as before (another
origin is an error, the page's own a warning).

It also resolves a relative handler, and its fetch interceptor a
relative URL, against location.href at the time of the request, while
jsdom's XHR sends to the document's own address. Tests that replaced
window.location with a stand-in on http://localhost while the page runs
on http://localhost:3000 sent their requests past every handler.
tests/helpers/location.ts builds such stand-ins on the page's own origin
(locationAt, pageUrl), and every one of them now uses it.

msw no longer escapes fake timers, and responses are timed differently,
which surfaced tests that ended with work still running: a held request
answering in the next test, a lookup still out when the assertions ran,
a reload switched by counting reads. Each of those now waits for, or
releases, what it started, and answers by what happened rather than by
a count.

The day panel suites share their setup through
tests/helpers/dayDetailPanel.ts instead of a copy each, which keeps the
larger one under its size limit.
This commit is contained in:
Maurice
2026-11-26 13:15:45 +01:00
parent 05f4c84885
commit 32837afe2e
24 changed files with 493 additions and 434 deletions
+7
View File
@@ -160,6 +160,13 @@ describe('helpStore: search', () => {
})
describe('helpStore: doc index', () => {
// Loading the index has no debounce, so these tests await the response directly.
// msw no longer runs its own timers outside fake ones, and a successful mocked
// response only arrives once a timer fires, so these tests run on real timers.
beforeEach(() => {
vi.useRealTimers()
})
it('loads the table of contents once and resolves titles from it', async () => {
let calls = 0
server.use(