Drop the e2e specs that assert layout rather than behavior
This commit is contained in:
parent
56c45fe386
commit
16cc2109d5
3 changed files with 7 additions and 79 deletions
|
|
@ -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:
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
})
|
||||
|
|
@ -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)
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue