Skip to content

Commit 86e4005

Browse files
authored
Parameterize undo e2e test (#1943)
<!-- CURSOR_SUMMARY --> --- > [!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. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2108a7d. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated description by cubic. --> --- ## 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. <sup>Written for commit 2108a7d. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
1 parent 70d4f59 commit 86e4005

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

e2e-tests/undo.spec.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { testSkipIfWindows, Timeout } from "./helpers/test_helper";
1+
import { PageObject, testSkipIfWindows, Timeout } from "./helpers/test_helper";
22
import { expect } from "@playwright/test";
33

4-
testSkipIfWindows("undo", async ({ po }) => {
5-
await po.setUp({ autoApprove: true });
4+
const runUndoTest = async (po: PageObject, nativeGit: boolean) => {
5+
await po.setUp({ autoApprove: true, nativeGit });
66
await po.sendPrompt("tc=write-index");
77
await po.sendPrompt("tc=write-index-2");
88

@@ -31,4 +31,12 @@ testSkipIfWindows("undo", async ({ po }) => {
3131
// Also, could be slow.
3232
timeout: Timeout.LONG,
3333
});
34+
};
35+
36+
testSkipIfWindows("undo", async ({ po }) => {
37+
await runUndoTest(po, false);
38+
});
39+
40+
testSkipIfWindows("undo with native git", async ({ po }) => {
41+
await runUndoTest(po, true);
3442
});

0 commit comments

Comments
 (0)