From 0a40f7c824963ad8d9eedea95d40f5dc43a9239d Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Mon, 28 Sep 2026 07:35:50 +0300 Subject: [PATCH] Fix failing test --- .../scanner/tests/logic/clip-scoring.test.ts | 14 +++++++------- app/features/scanner/tests/logic/montage.test.ts | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/features/scanner/tests/logic/clip-scoring.test.ts b/app/features/scanner/tests/logic/clip-scoring.test.ts index 5be724dd9..d7bbdef89 100644 --- a/app/features/scanner/tests/logic/clip-scoring.test.ts +++ b/app/features/scanner/tests/logic/clip-scoring.test.ts @@ -39,26 +39,26 @@ test("no window below the kill threshold", () => { assert.deepEqual(scoreWindows(kills(100, 105, 110), []), []); assert.deepEqual( stripped(scoreWindows(kills(100, 105, 110), [], { minKills: 3 })), - [windowOf(95, 114, 3, 110)], + [windowOf(95, 113, 3, 110)], ); }); test("a run of close kills is one window with lead and tail", () => { assert.deepEqual(stripped(scoreWindows(kills(100, 110, 125, 130), [])), [ - windowOf(95, 134, 4, 130), + windowOf(95, 133, 4, 130), ]); }); test("the clip start clamps to the stream start", () => { assert.deepEqual(stripped(scoreWindows(kills(2, 4, 6, 8), [])), [ - windowOf(0, 12, 4, 8), + windowOf(0, 11, 4, 8), ]); }); test("a long pause splits the streak", () => { assert.deepEqual( stripped(scoreWindows(kills(100, 105, 110, 115, 140, 145, 150, 155), [])), - [windowOf(95, 119, 4, 115), windowOf(135, 159, 4, 155)], + [windowOf(95, 118, 4, 115), windowOf(135, 158, 4, 155)], ); }); @@ -66,13 +66,13 @@ test("a death between two kills ends the streak", () => { assert.deepEqual(scoreWindows(kills(100, 105, 110, 115), [107.5]), []); assert.deepEqual( stripped(scoreWindows(kills(100, 105, 110, 115, 120), [116])), - [windowOf(95, 119, 4, 115)], + [windowOf(95, 118, 4, 115)], ); }); test("a death on a kill's second (a trade) counts after that kill", () => { assert.deepEqual(stripped(scoreWindows(kills(100, 105, 110, 115), [115])), [ - windowOf(95, 119, 4, 115), + windowOf(95, 118, 4, 115), ]); }); @@ -83,7 +83,7 @@ test("a streak is cut where its clip would outgrow the cap", () => { maxSeconds: 60, }), ), - [windowOf(95, 149, 4, 145), windowOf(155, 209, 4, 205)], + [windowOf(95, 148, 4, 145), windowOf(155, 208, 4, 205)], ); }); diff --git a/app/features/scanner/tests/logic/montage.test.ts b/app/features/scanner/tests/logic/montage.test.ts index 01f375cea..26e887703 100644 --- a/app/features/scanner/tests/logic/montage.test.ts +++ b/app/features/scanner/tests/logic/montage.test.ts @@ -75,7 +75,7 @@ describe("montageWindows", () => { { why: "a 3-splat streak within its cap", kills: [100, 110, 120], - expected: [[95, 124, 3]], + expected: [[95, 123, 3]], }, { why: "a 3-splat streak over its cap", @@ -85,12 +85,12 @@ describe("montageWindows", () => { { why: "a 4-splat streak may run longer than a 3-splat one", kills: [100, 112, 124, 136], - expected: [[95, 140, 4]], + expected: [[95, 139, 4]], }, { why: "a streak longer than the last count uses its cap", kills: [100, 108, 116, 124, 132, 140], - expected: [[95, 144, 6]], + expected: [[95, 143, 6]], }, { why: "streaks under the minimum are left out", @@ -105,7 +105,7 @@ describe("montageWindows", () => { // all five fit 60 s; their first three alone would also fit 30 s const windows = montageWindows(game(100, 105, 110, 125, 140), criteria); - expect(spans(windows)).toEqual([[95, 144, 5]]); + expect(spans(windows)).toEqual([[95, 143, 5]]); }); });