mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-11-13 17:08:20 +00:00
test: for tools - generators, text and verdicts, smoke
This commit is contained in:
@@ -7,6 +7,29 @@ import {
|
||||
trackErrors,
|
||||
} from "./helpers/page";
|
||||
|
||||
const GENERATOR_IDS = [
|
||||
"create-empty-png",
|
||||
"random-noise-png",
|
||||
"linear-gradient-png",
|
||||
"color-spectrum-png",
|
||||
"random-colors-png",
|
||||
"draw-grid-png",
|
||||
"placeholder-png",
|
||||
"blend-two-png",
|
||||
"step-colors-png",
|
||||
"emoji-to-png",
|
||||
"color-wheel-png",
|
||||
"complementary-png",
|
||||
"triadic-png",
|
||||
"tetradic-png",
|
||||
"analogous-png",
|
||||
"monochromatic-png",
|
||||
"shades-png",
|
||||
"mix-colors-png",
|
||||
"sort-colors-png",
|
||||
"text-to-png",
|
||||
] as const;
|
||||
|
||||
test.describe("generators", () => {
|
||||
test("single-color-png auto-runs and reacts to parameters", async ({
|
||||
page,
|
||||
@@ -24,10 +47,16 @@ test.describe("generators", () => {
|
||||
expectNoErrors(sink);
|
||||
});
|
||||
|
||||
test("create-empty-png page opens without errors", async ({ page }) => {
|
||||
const sink = trackErrors(page);
|
||||
await openTool(page, "create-empty-png");
|
||||
await expect(page.getByRole("heading", { level: 1 })).toBeVisible();
|
||||
expectNoErrors(sink);
|
||||
});
|
||||
for (const id of GENERATOR_IDS) {
|
||||
test(`tool ${id} produces a result image`, async ({ page }) => {
|
||||
const sink = trackErrors(page);
|
||||
await openTool(page, id);
|
||||
await expect(resultImage(page)).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Generate" })).toHaveCount(
|
||||
0,
|
||||
);
|
||||
await expectNoErrorAlert(page);
|
||||
expectNoErrors(sink);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user