26 lines
1.1 KiB
JavaScript
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('公司文件在员工端优先在线阅读、按授权下载并继续复用消息ID追问', async () => {
|
|
const [service, detail] = await Promise.all([
|
|
read('../src/services/broadcast.ts'),
|
|
read('../src/pages/user/broadcast/detail.vue')
|
|
]);
|
|
|
|
assert.match(service, /interface BroadcastAttachment/);
|
|
assert.match(service, /viewUrl: string/);
|
|
assert.match(service, /downloadUrl\?: string/);
|
|
assert.match(service, /allowDownload: boolean/);
|
|
assert.match(service, /getBroadcastAttachmentView/);
|
|
assert.match(detail, /公司文件/);
|
|
assert.match(detail, /attachment\.summary/);
|
|
assert.match(detail, /authenticatedFileUrl/);
|
|
assert.match(detail, /item.attachment.allowDownload && item.attachment.downloadUrl/);
|
|
assert.match(detail, /在线阅读/);
|
|
assert.match(detail, /watermark-layer/);
|
|
assert.match(detail, /saveBroadcastQuestionContext\(item\.value\.id/);
|
|
});
|