Files
probably-rendering-one-more…/apps/wiki/tests/model.test.ts
T
codex-bot a2330b22e2
python CI and deployment / verify-and-deploy (push) Successful in 7m23s
studio CI and deployment / verify-and-deploy (push) Failing after 5m28s
wiki CI and deployment / verify-and-deploy (push) Failing after 6m13s
Restructure into Wiki, Studio and Python monorepo with scoped CI
2026-10-25 21:13:43 +08:00

9 lines
630 B
TypeScript

import assert from 'node:assert/strict';
import {test} from 'node:test';
import {randomUUID} from 'node:crypto';
import {decodeCursor,encodeCursor,validSection} from '../src/lib/model';
test('timeline cursor preserves timestamp and ID, rejects malformed values',()=>{
const date='2026-10-22T00:00:00.000Z',id=randomUUID();assert.deepEqual(decodeCursor(encodeCursor(date,id)),[date,id]);assert.throws(()=>decodeCursor('invalid'));assert.equal(decodeCursor(),null);
});
test('only the five content sections are recognized',()=>{assert.equal(validSection('videos')?.kind,'video');assert.equal(validSection('unknown'),undefined);});