Files
radicle-explorer/tests/visual/project.spec.ts
T
Rūdolfs Ošiņš 2c022a40df Add visual snapshot tests
We use the cache Github action to store snapshots when pushing to master and
then load them in pull requests and run the visual tests against it.

This way we don't have to commit the images to the repository and always
get diffs to the latest master.

Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2022-12-16 15:06:05 +01:00

26 lines
898 B
TypeScript

import { test, expect, projectFixtureUrl } from "@tests/support/fixtures.js";
test("source tree page", async ({ page }) => {
await page.goto(projectFixtureUrl);
await expect(page).toHaveScreenshot();
});
test("commits page", async ({ page }) => {
await page.goto(
`${projectFixtureUrl}/remotes/hyn1mjueopwzrmb18c3zmgg8ei8qunn5wpg76ouymytfqkfxqx7bun/history`,
);
await expect(page).toHaveScreenshot({ fullPage: true });
});
test("commit page", async ({ page }) => {
await page.goto(
`${projectFixtureUrl}/remotes/hyn1mjueopwzrmb18c3zmgg8ei8qunn5wpg76ouymytfqkfxqx7bun/commits/d6318f7f3d9c15b8ac6dd52267c53220d00f0982`,
);
await expect(page).toHaveScreenshot({ fullPage: true });
});
test("markdown rendering", async ({ page }) => {
await page.goto(`${projectFixtureUrl}/tree/main/markdown/cheatsheet.md`);
await expect(page).toHaveScreenshot({ fullPage: true });
});