00c4c13283
build / build (push) Successful in 1m19s
列表正文改为按需读取;保留完整导出、版本隔离和有效标签筛选。 验证:前端全量、Go全量及隔离PG全mirror竞态通过;覆盖首批回调、续载失败与筛选分页。
22 lines
957 B
TypeScript
22 lines
957 B
TypeScript
import { describe, it, expect } from 'vitest'
|
|
import { buildQAWeeklyCSV } from './qaWeekly'
|
|
import { parseQualityFilters, qualityFiltersKey } from './qaOps'
|
|
import type { QARecordPage, QARecord } from './qaOps'
|
|
describe('quality filter and full-export contracts', () => {
|
|
it('compares filters independently of property ordering and rejects unknown fields', () => {
|
|
expect(qualityFiltersKey({ coverage: '是', is_correct: '否' })).toBe(
|
|
qualityFiltersKey({ is_correct: '否', coverage: '是' })
|
|
)
|
|
expect(() => parseQualityFilters({ tenant: 'x' })).toThrow()
|
|
expect(() => parseQualityFilters({ coverage: 4 })).toThrow()
|
|
})
|
|
it('rejects a complete-count page of truncated previews as a full export', () => {
|
|
const page = {
|
|
has_more: false,
|
|
total: 1,
|
|
items: [{ id: 'fixture', content_projection: 'summary' } as QARecord],
|
|
} as QARecordPage
|
|
expect(() => buildQAWeeklyCSV(page)).toThrow('预览')
|
|
})
|
|
})
|