Files

26 lines
1.1 KiB
JavaScript

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(list, /定向提醒/);
assert.match(detail, /item\.requiredRead/);
assert.match(detail, /item\.targeted/);
});