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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/12501-next-up-s-pace-line-wins-only-when-the-c → main 0 commits fork

  • Merged. scout/12501-next-up-s-pace-line-wins-only-when-the-c was merged into main as 8e10c2c.

Review

Sign in to review this change.
1 file changed +16 −1
test/week-pace.test.ts +16 −1
@@ -23,7 +23,7 @@ import { noteLimit } from "../src/core/standing.ts";
2323 import { addSubscription } from "../src/core/subscriptions.ts";
2424 import { recordUsage } from "../src/core/usage.ts";
2525 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";
2727
2828 quietLogs();
2929
@@ -255,3 +255,18 @@ describe("the pace line on the three surfaces (#12134)", () => {
255255 expect(answer.next.map((r) => r.thisWeek)).toEqual([true, true, true, false, false, false]);
256256 });
257257 });
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 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs