From a1fa7483f0c353d5821b21ccc19ffac7b428f4a6 Mon Sep 17 00:00:00 2001 From: Charlie Croom Date: Wed, 16 Sep 2026 10:21:58 -0400 Subject: [PATCH] Generate only the history needed by near-fit scrolling cases Co-authored-by: Amp Signed-off-by: Charlie Croom Amp-Thread-ID: https://ampcode.com/threads/T-01a0a149-b278-7550-acc4-356168b0c4b5 --- tests/browser/initial-position.spec.mjs | 27 ++++++++++++------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/tests/browser/initial-position.spec.mjs b/tests/browser/initial-position.spec.mjs index e7d46d82..0d653e82 100644 --- a/tests/browser/initial-position.spec.mjs +++ b/tests/browser/initial-position.spec.mjs @@ -116,19 +116,18 @@ readingTest( ); for (const count of [1, 3, 5, 7, 9]) { - test(`near-fit channel with ${count} mixed-height rows starts at bottom`, async ({ - page, - app, - }) => { - app.histories.set( - "primary/beta", - app.histories.get("primary/beta").slice(0, count), - ); - await open(page, app); - await select(page, "Beta"); - await bottom(page, app, `cold ${count}-row Beta`); - await select(page, "Alpha"); - await select(page, "Beta"); - await bottom(page, app, `warm ${count}-row Beta`); + const nearFitTest = test.extend({ + historyCounts: { alpha: 1, beta: count }, }); + nearFitTest( + `near-fit channel with ${count} mixed-height rows starts at bottom`, + async ({ page, app }) => { + await open(page, app); + await select(page, "Beta"); + await bottom(page, app, `cold ${count}-row Beta`); + await select(page, "Alpha"); + await select(page, "Beta"); + await bottom(page, app, `warm ${count}-row Beta`); + }, + ); }