import test from 'node:test' import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { assistantSessionLoadingCopy } from '../../src/utils/assistant-loading.js' test('loading explains permissions and recent conversations without invented progress', () => { assert.match(assistantSessionLoadingCopy(0), /操作权限和最近对话/) assert.equal(assistantSessionLoadingCopy(7999), assistantSessionLoadingCopy(0)) assert.match(assistantSessionLoadingCopy(8000), /响应比平时慢/) assert.match(assistantSessionLoadingCopy(20000), /等待服务器响应/) assert.match(assistantSessionLoadingCopy(90000), /先收起助手/) for (const ms of [0, 8000, 20000, 90000]) assert.doesNotMatch(assistantSessionLoadingCopy(ms), /完成|成功|%|即将/) }) test('preparing screen replaces stale recovery and action controls without artificial delays', () => { const main = readFileSync(new URL('../../src/components/BusinessAssistant/index.vue', import.meta.url), 'utf8') assert.match(main, /