Support native Git (experimental) (#338)
This commit is contained in:
@@ -1,22 +1,30 @@
|
||||
import { testSkipIfWindows } from "./helpers/test_helper";
|
||||
import { PageObject, testSkipIfWindows } from "./helpers/test_helper";
|
||||
import { expect } from "@playwright/test";
|
||||
|
||||
testSkipIfWindows("switch versions", async ({ po }) => {
|
||||
await po.setUp({ autoApprove: true });
|
||||
const runSwitchVersionTest = async (po: PageObject, nativeGit: boolean) => {
|
||||
await po.setUp({ autoApprove: true, nativeGit });
|
||||
await po.sendPrompt("tc=write-index");
|
||||
|
||||
await po.snapshotPreview();
|
||||
await po.snapshotPreview({ name: `v2` });
|
||||
|
||||
expect(
|
||||
await po.page.getByRole("button", { name: "Version" }).textContent(),
|
||||
).toBe("Version 2");
|
||||
await po.page.getByRole("button", { name: "Version" }).click();
|
||||
await po.page.getByText("Init Dyad app Undo").click();
|
||||
await po.snapshotPreview();
|
||||
await po.snapshotPreview({ name: `v1` });
|
||||
|
||||
await po.page.getByRole("button", { name: "Undo to latest version" }).click();
|
||||
// Should be same as the previous snapshot, but just to be sure.
|
||||
await po.snapshotPreview();
|
||||
await po.snapshotPreview({ name: `v1` });
|
||||
|
||||
await expect(po.page.getByText("Version 3")).toBeVisible();
|
||||
};
|
||||
|
||||
testSkipIfWindows("switch versions", async ({ po }) => {
|
||||
await runSwitchVersionTest(po, false);
|
||||
});
|
||||
|
||||
testSkipIfWindows("switch versions with native git", async ({ po }) => {
|
||||
await runSwitchVersionTest(po, true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user