1580ebd826
build / build (push) Successful in 1m8s
按北京时间各自然周截止对整张统计总表累计计数,字段取当前有效结论。 覆盖和正确各按周报是除以是加否,保留历史上报与冻结并优先展示动态累计。 新增30秒顺序刷新、本地规则和历史复用非模型依据,保护当前原问答与人工字段。 验证:完整make verify通过;隔离PostgreSQL全量mirror race通过; 恢复库与真实周报calc_metrics四点对拍、源点踩自然刷新、桌面/390px及PNG通过。 新增源同步成员变化、人工版本保护及跨策略标签间距回归已通过。 模型全量语义风险审核及正式业务回填尚未完成,未部署本版本。
21 lines
880 B
TypeScript
21 lines
880 B
TypeScript
import { it, expect } from 'vitest'
|
|
import { liveDashboardQuery } from './qaDashboardData'
|
|
const query = {
|
|
start: '2026-10-19T00:00:00+08:00',
|
|
end: '2026-10-20T08:00:00+08:00',
|
|
keyword: 'needle',
|
|
cursor: '',
|
|
limit: 20,
|
|
}
|
|
it('advances current-week dashboard end on each refresh without mutating the executed filter', () => {
|
|
const next = liveDashboardQuery(query, new Date('2026-10-20T09:00:00+08:00'))
|
|
expect(next.end).toBe('2026-10-20T01:00:00.000Z')
|
|
expect(next.start).toBe(query.start)
|
|
expect(next.keyword).toBe(query.keyword)
|
|
expect(query.end).toBe('2026-10-20T08:00:00+08:00')
|
|
})
|
|
it('never rolls an already closed selected week into a different week', () => {
|
|
const closed = { ...query, start: '2026-10-12T00:00:00+08:00', end: '2026-10-19T00:00:00+08:00' }
|
|
expect(liveDashboardQuery(closed, new Date('2026-10-20T09:00:00+08:00'))).toEqual(closed)
|
|
})
|