mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
test(e2e): modernize stale routes for 2.0 section URLs (#347)
The e2e specs predate the 2.0 section-route migration and navigated to
single-segment tool URLs (/resize) that now 404 (App.tsx only mounts
/:section/:toolId). This broke the whole e2e suite (Cross-Browser, Device
Matrix, E2E Full, Visual) - part of the known stale-spec backlog.
- Sweep 929 goto("/<tool>") -> goto("/<section>/<tool>") across 45 spec
files, using the authoritative TOOLS + toolSection() mapping. Two-segment
routes, top-level routes (/automate, /editor, ...), and intentional 404
tests (/nonexistent-*) are untouched.
- Implement the legacy redirects the specs already assert: the 1.x color
tools (brightness-contrast, saturation, color-channels, color-effects)
redirect to /image/adjust-colors (App.tsx). Good for old bookmarks too.
- Remove the analytics-consent page tests (gui-navigation + gui-visual);
#336 deleted that page.
Mechanical + biome-clean + web typecheck passes. Browser-specific behavior
can only be confirmed by the nightly e2e jobs.
This commit is contained in:
@@ -183,7 +183,7 @@ test.describe("Keyboard Shortcuts - Work From Any Page", () => {
|
||||
});
|
||||
|
||||
test("Cmd/Ctrl+Alt+1 navigates to Resize from a tool page", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/compress");
|
||||
await page.goto("/image/compress");
|
||||
await expect(page).toHaveURL("/compress");
|
||||
|
||||
await page.keyboard.press(`${MOD}+Alt+1`);
|
||||
@@ -278,7 +278,7 @@ test.describe("Keyboard Shortcuts - Escape Key", () => {
|
||||
test.describe("Keyboard Shortcuts - Textarea Suppression", () => {
|
||||
test("Cmd/Ctrl+/ does not navigate when focused on textarea", async ({ loggedInPage: page }) => {
|
||||
// Navigate to a tool that has a textarea (watermark-text has text input)
|
||||
await page.goto("/watermark-text");
|
||||
await page.goto("/image/watermark-text");
|
||||
|
||||
// Find a textarea or contenteditable element on the page
|
||||
const textarea = page.locator("textarea").first();
|
||||
@@ -296,7 +296,7 @@ test.describe("Keyboard Shortcuts - Textarea Suppression", () => {
|
||||
test("Cmd/Ctrl+Shift+D does not toggle theme when focused on a textarea", async ({
|
||||
loggedInPage: page,
|
||||
}) => {
|
||||
await page.goto("/watermark-text");
|
||||
await page.goto("/image/watermark-text");
|
||||
|
||||
const textarea = page.locator("textarea").first();
|
||||
if (await textarea.isVisible({ timeout: 3000 }).catch(() => false)) {
|
||||
@@ -395,7 +395,7 @@ test.describe("Keyboard Accessibility", () => {
|
||||
// ---------------------------------------------------------------------------
|
||||
test.describe("Keyboard Shortcuts - Cmd+K Cross-Page", () => {
|
||||
test("Cmd/Ctrl+K focuses search on a tool page", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/resize");
|
||||
await page.goto("/image/resize");
|
||||
|
||||
await page.keyboard.press(`${MOD}+k`);
|
||||
|
||||
@@ -552,7 +552,7 @@ test.describe("Keyboard Shortcuts - Rapid Sequences", () => {
|
||||
});
|
||||
|
||||
test("Cmd/Ctrl+/ from a tool page navigates to home", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/compress");
|
||||
await page.goto("/image/compress");
|
||||
await expect(page).toHaveURL("/compress");
|
||||
|
||||
await page.keyboard.press(`${MOD}+/`);
|
||||
|
||||
Reference in New Issue
Block a user