Files
knowledge-governance/web/src/QAWeeklyEditor.test.tsx
T
hermes 2902ba0af2
build / build (push) Successful in 1m6s
feat(qa): 周报页移除下载 MD 与下载明细 CSV 按钮
保留复制排版内容与自动保存;列表页的完整明细导出不受影响。
2026-10-26 16:26:02 +08:00

26 lines
1.2 KiB
TypeScript

import { renderToStaticMarkup } from 'react-dom/server'
import { describe, it, expect } from 'vitest'
import { QAWeekly } from './QAWeekly'
describe('weekly report editor surface', () => {
it('provides a weekly document editor, automatic-save status and a preview without an external-send action', () => {
const html = renderToStaticMarkup(<QAWeekly query={null} />)
expect(html).toContain('<textarea')
expect(html).toContain('周报草稿正文')
expect(html).toContain('自动保存')
expect(html).toContain('周报周次下拉选择')
expect(html).toContain('预览')
expect(html).toContain('data-mode="both"')
expect(html).toContain('qa-weekly-writing')
expect(html).toContain('qa-weekly-preview')
for (const label of ['编辑', '预览', '对照'])
expect(html).not.toMatch(new RegExp('<button[^>]*>' + label + '</button>'))
expect(html).not.toContain('qa-weekly-mode')
expect(html).toContain('复制排版内容')
expect(html).not.toContain('下载 MD')
expect(html).not.toContain('下载明细 CSV')
expect(html).not.toContain('复制 Markdown 原文')
expect(html).not.toContain('发送周报')
expect(html).not.toContain('发布周报')
})
})