test: 修正两处断言旧行为的存量测试(患者→我 文案、lab 段归并)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
link2026
2026-06-10 07:12:48 +08:00
parent 2e90139df7
commit 2e27677f80
2 changed files with 15 additions and 9 deletions

View File

@@ -18,14 +18,17 @@ struct SeriesBucketTests {
seriesKey: seriesKey)
}
@Test func skipsIndicatorsWithoutSeriesKey() {
@Test func indicatorsWithoutSeriesKeyFoldIntoLabBucket() {
// lab : seriesKey name+unit , minPoints
let now = Date()
let items = [
makeIndicator(value: "5.0", capturedAt: now, seriesKey: nil),
makeIndicator(value: "5.0", capturedAt: now.addingTimeInterval(-86_400), seriesKey: nil),
makeIndicator(value: "5.2", capturedAt: now, seriesKey: nil),
]
let buckets = SeriesBucket.build(from: items)
#expect(buckets.isEmpty)
#expect(buckets.count == 1)
#expect(buckets.first?.kind == .lab)
#expect(buckets.first?.lines.first?.points.count == 2)
}
@Test func filtersOutSeriesWithFewerThanMinPoints() {