mirror of
https://github.com/ershisan99/DevToysWeb.git
synced 2025-12-16 20:49:23 +00:00
test: add some tests
This commit is contained in:
6
tests/app/page.spec.ts
Normal file
6
tests/app/page.spec.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("VRT", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await expect(page).toHaveScreenshot();
|
||||
});
|
||||
BIN
tests/app/page.spec.ts-snapshots/VRT-1-chromium-darwin.png
Normal file
BIN
tests/app/page.spec.ts-snapshots/VRT-1-chromium-darwin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
BIN
tests/app/page.spec.ts-snapshots/VRT-1-firefox-darwin.png
Normal file
BIN
tests/app/page.spec.ts-snapshots/VRT-1-firefox-darwin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 90 KiB |
BIN
tests/app/page.spec.ts-snapshots/VRT-1-webkit-darwin.png
Normal file
BIN
tests/app/page.spec.ts-snapshots/VRT-1-webkit-darwin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 79 KiB |
35
tests/components/sidebar/tool-groups.spec.ts
Normal file
35
tests/components/sidebar/tool-groups.spec.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { expect, Page, test } from "@playwright/test";
|
||||
|
||||
function navExpandedButton(page: Page) {
|
||||
const nav = page.getByRole("navigation");
|
||||
return nav.getByRole("button", { expanded: true });
|
||||
}
|
||||
|
||||
test.describe("initial open/close states of accordion", () => {
|
||||
test("closed when go to /", async ({ page }) => {
|
||||
const button = navExpandedButton(page);
|
||||
|
||||
await page.goto("/");
|
||||
await expect(button).not.toBeVisible();
|
||||
});
|
||||
|
||||
test("closed when go to group pages", async ({ page }) => {
|
||||
const button = navExpandedButton(page);
|
||||
|
||||
await page.goto("/converters");
|
||||
await expect(button).not.toBeVisible();
|
||||
|
||||
await page.goto("/formatters");
|
||||
await expect(button).not.toBeVisible();
|
||||
});
|
||||
|
||||
test("opened when go to tool pages", async ({ page }) => {
|
||||
const button = navExpandedButton(page);
|
||||
|
||||
await page.goto("/converters/number-base");
|
||||
await expect(button).toBeVisible();
|
||||
|
||||
await page.goto("/formatters/json");
|
||||
await expect(button).toBeVisible();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user