fix: polish pass for traffic, nav, icons, contact email reveal and dashcam robustness
This commit is contained in:
@@ -9,7 +9,6 @@ import {
|
||||
} from '@/journey/dashcam-feed';
|
||||
import { DASHCAM_LENS, createDashcamLens, driftTarget } from '@/scene/world/dashcam-lens';
|
||||
import {
|
||||
chapterLabel,
|
||||
dashcamClock,
|
||||
dashcamTitle,
|
||||
frameBottomLeft,
|
||||
@@ -117,25 +116,25 @@ describe('dashcam telemetry', () => {
|
||||
sectionLabel: 'Infrastructure',
|
||||
chapter: 'pre-dawn',
|
||||
exit: '04',
|
||||
routePercent: 47,
|
||||
routePercent: 45,
|
||||
clock: '03:51',
|
||||
name: 'Luca Pîslaru',
|
||||
city: 'Bucharest',
|
||||
};
|
||||
|
||||
it('formats the document title', () => {
|
||||
expect(dashcamTitle(telemetry)).toBe('DASHCAM · 47% · INFRASTRUCTURE · 03:51');
|
||||
expect(dashcamTitle(telemetry)).toBe('DASHCAM · 45% · INFRASTRUCTURE · 03:51');
|
||||
});
|
||||
|
||||
it('formats the frame plates and the credit', () => {
|
||||
expect(frameTopLeft(telemetry)).toBe('DASHCAM · PRE DAWN · EXIT 04');
|
||||
expect(frameBottomLeft(telemetry)).toBe('ROUTE 47% · INFRASTRUCTURE');
|
||||
expect(frameTopLeft(telemetry)).toBe('DASHCAM · EXIT 04');
|
||||
expect(frameBottomLeft(telemetry)).toBe('ROUTE 45% · INFRASTRUCTURE');
|
||||
expect(postcardCredit(telemetry.name, telemetry.city)).toBe('NIGHT SHIFT · LUCA PÎSLARU · BUCHAREST');
|
||||
expect(chapterLabel('selected-builds')).toBe('SELECTED BUILDS');
|
||||
});
|
||||
|
||||
it('rounds and clamps route progress', () => {
|
||||
expect(routePercent(0.474)).toBe(47);
|
||||
it('rounds and clamps route progress on the tab title\'s 5% step', () => {
|
||||
expect(routePercent(0.474)).toBe(45);
|
||||
expect(routePercent(0.476)).toBe(50);
|
||||
expect(routePercent(1.4)).toBe(100);
|
||||
expect(routePercent(-1)).toBe(0);
|
||||
expect(routePercent(Number.NaN)).toBe(0);
|
||||
|
||||
Reference in New Issue
Block a user