cmvr-wms/mobile-app/tests/operation-guide.test.mjs
lixiaolong af36af4cab feat(ui): 添加操作指引功能并优化登录和盘点流程
- 在页面标题栏添加操作指引图标,显示相关功能说明
- 实现登录页面连接状态提示和验证码刷新机制
- 优化盘点功能,区分账面数量和实际盘点数量
- 改进AI助手附件上传状态反馈和错误处理
- 添加BOM编辑器和采购页面操作指引
- 实现登录页面连接状态提示和验证码刷新机制
2026-10-18 22:30:47 +08:00

24 lines
1.3 KiB
JavaScript

import test from 'node:test';
import assert from 'node:assert/strict';
import {modules} from '../src/core/modules.ts';
import {readFile} from 'node:fs/promises';
test('only dependency-sensitive mobile pages have concise operation guidance', () => {
assert.deepEqual(modules.filter(m=>m.guide).map(m=>m.key), ['stock','purchase','pending','loans','check','production']);
for(const m of modules.filter(m=>m.guide)) {
assert.ok(m.guide.length <= 80, `${m.key} should not become a manual`);
assert.ok(!m.guide.includes('\n'));
}
});
test('mobile guide belongs to a header action, not a permanent list banner', async()=>{
const app=await readFile(new URL('../src/App.tsx',import.meta.url),'utf8');
assert.ok(app.includes("accessibilityLabel={selected.title+'操作指引'}"));
assert.ok(app.includes("Alert.alert(selected.title+' · 操作指引',selected.guide)"));
assert.ok(!app.slice(app.indexOf('function BusinessList')).includes('module.guide'));
});
test('guidance distinguishes creating records from changing actual stock', () => {
assert.match(modules.find(m=>m.key==='pending').guide, /确认后,才计入库存/);
assert.match(modules.find(m=>m.key==='check').guide, /不是差异数量.*确认后才调整库存/);
assert.match(modules.find(m=>m.key==='production').guide, /物品、产品和 BOM.*生产任务/);
});