Files
memind/tkmind-loading-tips.test.mjs
T
john a29e1ec5c8 fix(agent-run): align cursor executor path with 103 production hotfixes
Recover requiredExecutor fallback, direct cursor launch in tool gateway,
and user-facing brand sanitization in source so the next portal release
can replace manual bundled edits on 103.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-27 09:31:36 +08:00

31 lines
1.1 KiB
JavaScript

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);
});