test: add M1 broadcast acceptance reproducers
This commit is contained in:
@@ -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/);
|
||||
});
|
||||
Reference in New Issue
Block a user