feat: add Night Shift layer (boot intro, ops strip, headlight, chapter numerals, film grain)
This commit is contained in:
21
tests/unit/operations.test.ts
Normal file
21
tests/unit/operations.test.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { bucharestClock, uptimeSince } from '@/lib/operations';
|
||||
|
||||
describe('uptimeSince', () => {
|
||||
const start = new Date('2025-08-01T00:00:00Z');
|
||||
it('is zero at the start', () => {
|
||||
expect(uptimeSince(start, start)).toEqual({ months: 0, days: 0 });
|
||||
});
|
||||
it('counts whole months and remaining days', () => {
|
||||
expect(uptimeSince(start, new Date('2026-10-10T00:00:00Z'))).toEqual({ months: 14, days: 9 });
|
||||
});
|
||||
it('clamps to zero before the start', () => {
|
||||
expect(uptimeSince(start, new Date('2025-01-01T00:00:00Z'))).toEqual({ months: 0, days: 0 });
|
||||
});
|
||||
});
|
||||
|
||||
describe('bucharestClock', () => {
|
||||
it('formats HH:MM in Europe/Bucharest', () => {
|
||||
expect(bucharestClock(new Date('2026-01-15T10:05:00Z'))).toBe('12:05');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user