fix: preserve turnover deep-link snapshots and clarify data status
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { turnoverChart, turnoverNumber, windowText } from './turnoverPresentation'
|
||||
import { turnoverChart, turnoverNumber, windowText, turnoverReasonsText } from './turnoverPresentation'
|
||||
import type { TurnoverCharts, TurnoverWindowMetric } from './turnoverTypes'
|
||||
describe('turnover honest precision and charts', () => {
|
||||
it('explains missing samples and zero average stock without exposing internal statuses', () => {
|
||||
expect(turnoverReasonsText(['INSUFFICIENT'])).toBe('合格日库存样本不足')
|
||||
expect(turnoverReasonsText(['ZERO_AVERAGE_STOCK'])).toContain('每日观测未捕获存量')
|
||||
expect(turnoverReasonsText(['INVENTORY_UNKNOWN_OR_STALE'])).toContain('已过期')
|
||||
})
|
||||
it('keeps tiny positive values distinct from zero and unknown', () => {
|
||||
expect(turnoverNumber(0.000001)).toBe('<0.01')
|
||||
expect(turnoverNumber(0.01, 1)).toBe('<0.1')
|
||||
|
||||
Reference in New Issue
Block a user