Files
radicle-explorer/tests/visual/mobile/repo.spec.ts
T
Sebastian Martinez a34056b2bf Remove sinon in favor of existing APIs of playwright and vitest
We where using `sinon` in the `playwright` tests to simulate a different
time, which since `playwright@1.45.0` can be done with the Clock API
calling `page.clock.setFixedTime`.

And to test the mutex executor we can use the vitest utils spy function
`vi.fn()` instead of `sinon.spy()`
2024-08-29 10:11:04 +02:00

35 lines
982 B
TypeScript

import {
aliceRemote,
expect,
sourceBrowsingUrl,
test,
} from "@tests/support/fixtures.js";
test("source tree page", async ({ page }) => {
await page.goto(sourceBrowsingUrl, { waitUntil: "networkidle" });
await expect(page).toHaveScreenshot();
});
test("commits page", async ({ page }) => {
await page.clock.setFixedTime(new Date("November 24 2022 12:00:00"));
await page.goto(
`${sourceBrowsingUrl}/remotes/${aliceRemote.substring(8)}/history`,
{
waitUntil: "networkidle",
},
);
await expect(page).toHaveScreenshot({ fullPage: true });
});
test("commit page", async ({ page }) => {
await page.clock.setFixedTime(new Date("November 24 2022 12:00:00"));
await page.goto(
`${sourceBrowsingUrl}/remotes/${aliceRemote.substring(
8,
)}/commits/1aded56c3ad55299df9f06c326af50b802a05949`,
);
await expect(page.getByText("subconscious.txt added")).toBeVisible();
await expect(page).toHaveScreenshot({ fullPage: true });
});