test: add M1 broadcast acceptance reproducers

This commit is contained in:
2026-07-23 11:27:53 +08:00
parent f023417aed
commit cd94f4fe9f
3 changed files with 210 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises';
import test from 'node:test';
const read = (path) => readFile(new URL(path, import.meta.url), 'utf8');
test('M1 员工端可筛选与我有关和必读未读消息,并保留公开频道', async () => {
const [service, list, detail] = await Promise.all([
read('../src/services/broadcast.ts'),
read('../src/pages/user/broadcast/index.vue'),
read('../src/pages/user/broadcast/detail.vue')
]);
assert.match(service, /export type BroadcastMessageScope = 'ALL' \| 'RELATED' \| 'REQUIRED_UNREAD';/);
assert.match(service, /scope=\$\{scope\}/);
assert.match(list, /const scope = ref<BroadcastMessageScope>\('ALL'\)/);
assert.match(list, /scopeOptions/);
assert.match(list, /@click="changeScope\(option\.value\)"/);
assert.match(list, /listBroadcastMessages\(1, pageSize, scope\.value\)/);
assert.match(list, /item\.requiredRead/);
assert.match(list, /item\.targeted/);
assert.match(detail, /item\.requiredRead/);
assert.match(detail, /item\.targeted/);
});