import test from 'node:test'; import assert from 'node:assert/strict'; import { TKMIND_LOADING_TIPS, pickTkmindLoadingTip } from './tkmind-loading-tips.mjs'; test('TKMIND_LOADING_TIPS has intro news joke poem entries', () => { const categories = new Set(TKMIND_LOADING_TIPS.map((item) => item.category)); assert.ok(categories.has('intro')); assert.ok(categories.has('news')); assert.ok(categories.has('joke')); assert.ok(categories.has('poem')); for (const item of TKMIND_LOADING_TIPS) { assert.ok(item.text.trim().length >= 8); assert.doesNotMatch(item.text, /Cursor/i); } }); test('pickTkmindLoadingTip is deterministic for the same seed', () => { const first = pickTkmindLoadingTip({ seed: 'run-123' }); const second = pickTkmindLoadingTip({ seed: 'run-123' }); assert.equal(first.text, second.text); }); test('pickTkmindLoadingTip can exclude recent tips', () => { const only = TKMIND_LOADING_TIPS[0]; const picked = pickTkmindLoadingTip({ seed: 'exclude-test', exclude: TKMIND_LOADING_TIPS.filter((item) => item.text !== only.text).map((item) => item.text), }); assert.equal(picked.text, only.text); });