scene: two quick sky changes build the last sky; Night drift test is exact #57
Loading…
Reference in a new issue
No description provided.
Delete branch "void/scene-test-strength"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two test strengthenings you asked for, and the bug the first one found.
Bug (in dev since #55,
index.ts). A rebuild read the sky choice before awaiting its key and acted on it after. With Auto at night,setSkyState('day')thensetSkyState('dusk')in quick succession left the Day scene live: the last sky built was#95c6ff(Day's ridge top) where#aa91dc(Dusk's) was chosen, and the old test passed because it only counted disposals. Fix: after the key is in hand a rebuild stands down if the choice moved (that change has its own rebuild). No change for the single-change path.Tests.
index.test.ts"keeps only the latest of two quick changes": now asserts the last sky built is the last one chosen (Dusk), it is the live scene (a login reaches it and no other), and every other scene was disposed while the live one was not. It fails on dev'sindex.ts(expected '#95c6ff' to be '#aa91dc') and passes with the fix.skyTheme.test.tsdrift test: exact equality ofNIGHT_SKY_LIGHTESTandskyBackdrop('night').lightest(the 1e-6 tolerance let 0.081641 through). Checked: mutating the constant to 0.081643 makes it fail.Run: vitest
src/app/features/sceneandsrc/sky412/412, prettier and eslint clean on the touched files. No production build; nothing seen rendered.🤖 Generated with Claude Code