Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions runner/e2e/all-demos.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,22 @@ test("the owner filter shows one person's demos, and the view is a link", async
await expect(page).not.toHaveURL(/owner=/);
});

test("a pasted filter link filters regardless of its case", async ({ page }) => {
// The URL is the shareable artefact, and pasted links arrive hand-edited or
// autocapitalised. The slug has to match case-insensitively end to end: the
// grid filters AND the picker names the person — a filtered grid under an
// "Everyone" label would read as the whole team having two demos.
await stubShell(page);
await signIn(page);
await stubDemos(page);
await page.goto("/all-demos?owner=SOMEONE.ELSE");

await expect(card(page, "Their grid")).toBeVisible();
await expect(card(page, "Their second grid")).toBeVisible();
await expect(card(page, "My grid")).toHaveCount(0);
await expect(page.getByRole("button", { name: "Filter demos by owner" })).toContainText("Someone Else (2)");
});

test("a filter that matches nobody says whose it was", async ({ page }) => {
await stubShell(page);
await signIn(page);
Expand Down
12 changes: 12 additions & 0 deletions runner/pipeline/demo-owners.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ test("a row with no owner is counted in the total but gets no option", () => {
assert.deepEqual(options.slice(1).map((o) => o.value), ["dev"]);
});

test("two casings of one address are one owner, not two", () => {
// `created_by` has two writers (DEV-2501): the browser stores the broker's
// casing, the MCP path a normalised one. Options keyed on the raw value would
// list the same person twice, each with half their demos.
const options = ownerOptions(
[demo("Dev@Handsontable.com", "a"), demo("dev@handsontable.com", "b")],
displayNameFromEmail,
);
assert.deepEqual(options.map((o) => o.label), ["Everyone (2)", "Dev (2)"]);
assert.equal(options[1].value, "dev");
});

test("filtering matches on the slug, case-insensitively", () => {
assert.deepEqual(filterByOwner(LIST, "marek.martuszewski").map((d) => d.id), ["a", "c", "e"]);
assert.deepEqual(filterByOwner(LIST, "MAREK.MARTUSZEWSKI").map((d) => d.id), ["a", "c", "e"]);
Expand Down
Loading