Release Colour Tools 0.2.0
Verify / verify (push) Canceled after 0s

This commit is contained in:
2026-09-02 07:11:11 +02:00
parent 0c1fc94b58
commit ed030cada6
34 changed files with 1446 additions and 74 deletions
+36 -2
View File
@@ -71,6 +71,14 @@ test("converts, composites and interpolates without transient empty results", as
await expect(page.locator(".step-swatch")).toHaveCount(9);
await page.getByLabel(/Swatches/u).fill("5");
await expect(page.locator(".step-swatch")).toHaveCount(5);
await page.getByLabel("Gradient type").selectOption("radial");
await expect(page.locator(".gradient-preview + pre")).toContainText(
"radial-gradient(ellipse at center",
);
await page.getByText("Repeating", { exact: true }).click();
await expect(page.locator(".gradient-preview + pre")).toContainText(
"repeating-radial-gradient",
);
expect(externalRequests).toEqual([]);
expect(runtimeErrors).toEqual([]);
@@ -123,9 +131,35 @@ test("keeps picking, accessibility analysis and palette data browser-local", asy
"--brand-primary",
);
await page.getByLabel("Palette data").fill(
JSON.stringify({
vivid: {
$type: "color",
$value: {
colorSpace: "display-p3",
components: [0.9, 0.2, 0.1],
},
},
vividAlias: { $value: "{vivid}" },
}),
);
await page.getByRole("button", { name: "Import colours" }).click();
await expect(page.getByRole("status")).toContainText(
"Added 1 colour; ignored 1 exact duplicate",
);
await expect(page.locator(".saved-colour-list > li")).toHaveCount(4);
await expect(page.locator(".contrast-matrix tbody tr")).toHaveCount(4);
await expect(
page.locator(".contrast-matrix tbody tr").first().locator("td"),
).toHaveCount(4);
await page.getByLabel("Format").selectOption("tokens");
await expect(page.locator(".export-preview")).toContainText(
"https://www.designtokens.org/schemas/2025.10/format.json",
);
await page.reload();
await page.getByRole("tab", { name: /Palette/u }).click();
await expect(page.locator(".saved-colour-list > li")).toHaveCount(3);
await expect(page.locator(".saved-colour-list > li")).toHaveCount(4);
expect(externalRequests).toEqual([]);
expect(runtimeErrors).toEqual([]);
@@ -194,7 +228,7 @@ test("serves a relocatable production artifact with hardened headers", async ({
expect(manifest.headers()["content-type"]).toContain("application/json");
await expect(manifest.json()).resolves.toMatchObject({
id: "de.add-ideas.colour-tools",
version: "0.1.0",
version: "0.2.0",
entry: "./",
icon: "./favicon.svg",
});
+18
View File
@@ -0,0 +1,18 @@
import { expect, test } from "@playwright/test";
test("keeps the primary workspace inside a narrow viewport", async ({
page,
}) => {
await page.goto("/deep/nested/colour/");
await expect(page.locator("main").first()).toBeVisible();
await expect(
page.locator("main .loading, main .workbench-loading"),
).toHaveCount(0);
const widths = await page.evaluate(() => ({
content: document.documentElement.scrollWidth,
viewport: document.documentElement.clientWidth,
}));
expect(widths.viewport).toBeLessThanOrEqual(430);
expect(widths.content).toBeLessThanOrEqual(widths.viewport + 1);
});