switch versions e2e (#312)

This commit is contained in:
Will Chen
2025-06-02 21:31:47 -07:00
committed by GitHub
parent 0a8e40c73c
commit 4997a8f2ff
5 changed files with 41 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
import { test } from "./helpers/test_helper";
import { expect } from "@playwright/test";
test("switch versions", async ({ po }) => {
await po.setUp({ autoApprove: true });
await po.sendPrompt("tc=write-index");
await po.snapshotPreview();
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.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 expect(po.page.getByText("Version 3")).toBeVisible();
});