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
2108a7d73669794f0052192e8b5a1ffac3d54ec1. 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 2108a7d73669794f0052192e8b5a1ffac3d54ec1.
Summary will update automatically on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
This commit is contained in:
Will Chen
2025-12-12 13:13:39 -08:00
committed by GitHub
parent 70d4f5980e
commit 86e4005795

View File

@@ -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);
});