26 lines
1.2 KiB
TypeScript
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('发布周报')
|
|
})
|
|
})
|