fix: polish pass for traffic, nav, icons, contact email reveal and dashcam robustness
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { SceneResourceBag } from '@/scene/resources';
|
||||
import {
|
||||
MILESTONE_FLASH_MAX_RATE,
|
||||
createMilestones,
|
||||
MILESTONE_FAR_Z,
|
||||
MILESTONE_NEAR_Z,
|
||||
@@ -100,6 +101,24 @@ describe('mile marker mesh', () => {
|
||||
resources.dispose();
|
||||
});
|
||||
|
||||
it('does not flash posts swept past by a navigator jump or a fling', () => {
|
||||
const resources = new SceneResourceBag();
|
||||
const markers = createMilestones(resources, true);
|
||||
// A navigator long-scroll crosses the whole chapter in about 0.6 s.
|
||||
let peak = 0;
|
||||
for (let frame = 0; frame <= 36; frame += 1) {
|
||||
markers.update('experience', frame / 36, 0, 1 / 60);
|
||||
peak = Math.max(peak, ...markers.flashes());
|
||||
}
|
||||
expect(peak).toBe(0);
|
||||
// Parked, then a single wheel tick at reading pace still flashes the post it crosses.
|
||||
for (let i = 0; i < 90; i += 1) markers.update('experience', passPoint(3, 4) + 0.01, 0, 1 / 60);
|
||||
markers.update('experience', passPoint(3, 4) - 0.01, 0, 1 / 60);
|
||||
expect(markers.flashes()[3]).toBe(1);
|
||||
expect(MILESTONE_FLASH_MAX_RATE).toBeGreaterThan(0.5);
|
||||
resources.dispose();
|
||||
});
|
||||
|
||||
it('never flashes on the low tier or touch', () => {
|
||||
const resources = new SceneResourceBag();
|
||||
const markers = createMilestones(resources, false);
|
||||
|
||||
Reference in New Issue
Block a user