From 86e4005795d2d7e8ff12840c368967e5248651fd Mon Sep 17 00:00:00 2001 From: Will Chen Date: Fri, 12 Dec 2025 13:13:39 -0800 Subject: [PATCH] Parameterize undo e2e test (#1943) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- > [!NOTE] > Parameterizes the undo e2e test and adds a second run using native Git via a shared helper. > > - **Tests (e2e)**: > - Refactor `e2e-tests/undo.spec.ts` to use `runUndoTest(po, nativeGit)` helper. > - Pass `nativeGit` through `po.setUp({ autoApprove: true, nativeGit })`. > - Import `PageObject` from `helpers/test_helper`. > - Add second test "undo with native git" alongside existing "undo" test. > > Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2108a7d73669794f0052192e8b5a1ffac3d54ec1. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot). --- ## Summary by cubic Parameterized the undo e2e test to run with and without native Git, improving coverage without duplicating code. - **Refactors** - Added runUndoTest(po, nativeGit) helper and passed nativeGit to setUp. - Split into two test cases: “undo” and “undo with native git”. - Minor whitespace-only formatting updates in snapshot and fixture files. Written for commit 2108a7d73669794f0052192e8b5a1ffac3d54ec1. Summary will update automatically on new commits. --- e2e-tests/undo.spec.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/e2e-tests/undo.spec.ts b/e2e-tests/undo.spec.ts index 3f03430..819b221 100644 --- a/e2e-tests/undo.spec.ts +++ b/e2e-tests/undo.spec.ts @@ -1,8 +1,8 @@ -import { testSkipIfWindows, Timeout } from "./helpers/test_helper"; +import { PageObject, testSkipIfWindows, Timeout } from "./helpers/test_helper"; import { expect } from "@playwright/test"; -testSkipIfWindows("undo", async ({ po }) => { - await po.setUp({ autoApprove: true }); +const runUndoTest = async (po: PageObject, nativeGit: boolean) => { + await po.setUp({ autoApprove: true, nativeGit }); await po.sendPrompt("tc=write-index"); await po.sendPrompt("tc=write-index-2"); @@ -31,4 +31,12 @@ testSkipIfWindows("undo", async ({ po }) => { // Also, could be slow. timeout: Timeout.LONG, }); +}; + +testSkipIfWindows("undo", async ({ po }) => { + await runUndoTest(po, false); +}); + +testSkipIfWindows("undo with native git", async ({ po }) => { + await runUndoTest(po, true); });