Public: anyone can read this; the crew can change it.
Next up's pace line wins only when the cost line is unknown: a test shows both #16763
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/12501-next-up-s-pace-line-wins-only-when-the-c → main 0 commits fork
1 file
changed +16
−1
test/week-pace.test.ts +16 −1
| @@ -23,7 +23,7 @@ import { noteLimit } from "../src/core/standing.ts"; | ||
| 23 | 23 | import { addSubscription } from "../src/core/subscriptions.ts"; |
| 24 | 24 | import { recordUsage } from "../src/core/usage.ts"; |
| 25 | 25 | import { createUser, getUserByName } from "../src/core/users.ts"; |
| 26 | import { cutWords, daysLeftInWeek, lineAfter, paceWords, paceCut, weekView } from "../src/flow/week.ts"; | |
| 26 | import { cutWords, daysLeftInWeek, lineAfter, paceWords, paceCut, weekView, type Cut } from "../src/flow/week.ts"; | |
| 27 | 27 | |
| 28 | 28 | quietLogs(); |
| 29 | 29 | |
| @@ -255,3 +255,18 @@ describe("the pace line on the three surfaces (#12134)", () => { | ||
| 255 | 255 | expect(answer.next.map((r) => r.thisWeek)).toEqual([true, true, true, false, false, false]); |
| 256 | 256 | }); |
| 257 | 257 | }); |
| 258 | ||
| 259 | describe("lineAfter: one line wins, never both (#12501)", () => { | |
| 260 | const pace = { rows: 5, reason: "by pace" }; | |
| 261 | const base: Cut = { fits: [1, 2], shipLow: 0, shipHigh: 0, confidence: "low", unsure: null }; | |
| 262 | ||
| 263 | test("a known cost line wins even when a pace line is also present and differs", () => { | |
| 264 | expect(lineAfter({ cut: base, pace })).toBe(2); | |
| 265 | }); | |
| 266 | test("an unsure cost line yields to the pace line, which differs from the cost line's count", () => { | |
| 267 | expect(lineAfter({ cut: { ...base, unsure: "no limit seen" }, pace })).toBe(5); | |
| 268 | }); | |
| 269 | test("unsure with no pace draws no line", () => { | |
| 270 | expect(lineAfter({ cut: { ...base, unsure: "no limit seen" }, pace: null })).toBeNull(); | |
| 271 | }); | |
| 272 | }); |
new above
offline