diff --git a/e2e/USER_STORIES.md b/e2e/USER_STORIES.md index afbc155f..afd7567c 100644 --- a/e2e/USER_STORIES.md +++ b/e2e/USER_STORIES.md @@ -4,6 +4,13 @@ The catalog e2e specs are written from. Each story is a slice of behavior a person can observe in the running app. Specs reference stories by stable id (`US-042`), so numbers are never reused or renumbered. +A story is behavior someone can describe without reading the css: what a button +does, what a feed contains, what a notification says. A layout threshold, a +padding, a color or a wording is not one, and a change that only moves one +belongs in the acceptance text of the story it sits under rather than in a story +of its own. Nothing in CI runs this suite, so every spec is a cost paid by hand +forever. + **Personas** come from `e2e/harness/keys.ts`, which defines four deterministic identities: diff --git a/e2e/specs/multiuser.spec.ts b/e2e/specs/multiuser.spec.ts deleted file mode 100644 index 3c02be17..00000000 --- a/e2e/specs/multiuser.spec.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {expect, roomPath, test, users} from "../harness" - -test("delivers one user's message to another user's open page", async ({seed, as}) => { - const scenario = await seed(({relay, user}) => { - const space = relay("space") - - space.room("general", {name: "General"}) - space.join(user.alice, "general") - space.join(user.bob, "general") - }) - - const {url} = scenario.space("space") - const path = roomPath(url, "general") - - // Two browser contexts, two identities, one relay: bob's page is already listening when alice - // sends, so the message reaches him over the wire rather than out of a shared repository. - const alice = await as(users.alice, path) - const bob = await as(users.bob, path) - - await expect(bob.getByRole("link", {name: "General"})).toBeVisible() - - await alice.locator(".chat-editor [contenteditable=true]").pressSequentially("anyone there?") - await alice.locator(".chat-editor [contenteditable=true]").press("Enter") - - await expect(alice.getByText("anyone there?")).toBeVisible() - await expect(bob.getByText("anyone there?")).toBeVisible() -}) diff --git a/e2e/specs/space.spec.ts b/e2e/specs/space.spec.ts index 54ea5d3c..4fc6b6ce 100644 --- a/e2e/specs/space.spec.ts +++ b/e2e/specs/space.spec.ts @@ -1,30 +1,5 @@ -import {HOUR, MINUTE} from "@welshman/lib" import {expect, roomPath, test, users} from "../harness" -test("renders a seeded space, its rooms and its messages", async ({seed, as}) => { - const scenario = await seed(({relay, user, at}) => { - const space = relay("space") - - space.room("general", {name: "General"}) - space.room("random", {name: "Random"}) - space.join(user.alice, "general") - space.join(user.bob, "general") - space.message(user.bob, "general", "morning all", at(2, HOUR)) - space.message(user.alice, "general", "morning!", at(90, MINUTE)) - }) - - const {url} = scenario.space("space") - const page = await as(users.alice, roomPath(url, "general")) - - // The room the user belongs to and the one they don't are both advertised by the relay, so - // both appear in the space menu. - await expect(page.getByRole("link", {name: "General"})).toBeVisible() - await expect(page.getByRole("link", {name: "Random"})).toBeVisible() - - await expect(page.getByText("morning all")).toBeVisible() - await expect(page.getByText("morning!")).toBeVisible() -}) - test("opens the space menu in a drawer on a phone", async ({seed, as}) => { const scenario = await seed(({relay, user}) => { const space = relay("space") @@ -76,30 +51,3 @@ test("opens the space menu in a drawer on a phone", async ({seed, as}) => { await expect(drawer.getByRole("link", {name: "General"})).toBeVisible() }) - -test("keeps the drawer's space rail free of a horizontal scrollbar", async ({seed, as}) => { - const scenario = await seed(({relay, user}) => { - const space = relay("space") - - space.room("general", {name: "General"}) - space.join(user.alice, "general") - }) - - const {url} = scenario.space("space") - - // No touch, so the app is not in mobile mode and hover tooltips are live. The rail scrolls - // vertically, which makes it scroll horizontally too, and a tooltip is 140px wider than it is. - const page = await as(users.alice, roomPath(url, "general"), { - context: {viewport: {width: 390, height: 844}}, - }) - - await page.getByRole("button", {name: "Open space menu"}).click() - - const rail = page.locator(".drawer .primary-nav") - - await expect(rail).toBeVisible() - - const overflow = await rail.evaluate(el => el.scrollWidth - el.clientWidth) - - expect(overflow).toBe(0) -})