fix: polish pass for traffic, nav, icons, contact email reveal and dashcam robustness

This commit is contained in:
2026-10-11 15:11:44 +03:00
parent ca12cfda44
commit 1326cee886
49 changed files with 809 additions and 226 deletions

View File

@@ -187,6 +187,35 @@ describe("SceneCanvas", () => {
wrapper.unmount();
});
it("writes html[data-dawn] without the scene only when the step changes", async () => {
const wrapper = mount(SceneCanvas, {
props: {
journey: journey(),
policy: policy({ allowSceneRequest: false, maximumTier: "static", reason: "system-reduce" }),
quality: "static",
sceneDescription: "A decorative night road behind the portfolio content.",
},
});
await flushPromises();
expect(document.documentElement.dataset.dawn).toBe("night");
const writes: string[] = [];
const observer = new MutationObserver((records) => {
for (const record of records) if (record.attributeName === "data-dawn") writes.push(document.documentElement.dataset.dawn ?? "");
});
observer.observe(document.documentElement, { attributes: true, attributeFilter: ["data-dawn"] });
// A scroll replaces the snapshot every frame; the step does not change.
for (let frame = 1; frame <= 6; frame++) {
await wrapper.setProps({ journey: journey({ scrollY: frame * 40, routeProgress: 0.42 + frame / 100 }) });
await flushPromises();
}
await wrapper.setProps({ journey: journey({ scrollY: 9000, routeProgress: 1, arrived: true }) });
await flushPromises();
observer.disconnect();
expect(writes).toEqual(["day"]);
wrapper.unmount();
expect(document.documentElement.dataset.dawn).toBeUndefined();
});
it("aborts and removes the canvas on a Static transition", async () => {
const wrapper = mount(SceneCanvas, {
props: {