Skip to content

Commit 4ef0d80

Browse files
loganjclassy-murderbot
andcommitted
test(browser): count only panel tabs in the crowded-tab journey
#505 turned the new-tab picker's category switcher into a tablist (Channels, DMs, Tools). The crowded-tab journey still read every role=tab in the workspace, so with the picker open it counted 2 panel tabs plus 3 picker tabs and failed at channel-tabs.spec.mjs:309 on Chromium and WebKit. Its last()/first() lookups also resolved to picker tabs instead of the strip. Scope those lookups to the "Panel tabs" tablist, matching how #505 scoped the other counts in this file. Product behavior is unchanged. Co-authored-by: classy-murderbot <[email protected]> Signed-off-by: Logan Johnson <[email protected]>
1 parent 69a9af2 commit 4ef0d80

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎tests/browser/channel-tabs.spec.mjs‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -298,18 +298,18 @@ test("crowded tab strip scrolls only horizontally with Add tab fixed and a thin
298298
});
299299
const initial = await add.boundingBox();
300300
const height = (await header.boundingBox()).height;
301-
const tabBounds = await workspace.getByRole("tab").first().boundingBox();
301+
const tabBounds = await list.getByRole("tab").first().boundingBox();
302302
const expectTabPosition = async () => {
303-
const bounds = await workspace.getByRole("tab").last().boundingBox();
303+
const bounds = await list.getByRole("tab").last().boundingBox();
304304
expect(bounds.y).toBeCloseTo(tabBounds.y, 1);
305305
expect(bounds.height).toBeCloseTo(tabBounds.height, 1);
306306
};
307307
for (let i = 0; i < 5; i++) {
308308
await add.click();
309-
await expect(workspace.getByRole("tab")).toHaveCount(i + 2);
309+
await expect(list.getByRole("tab")).toHaveCount(i + 2);
310310
await expect(workspace.getByRole("searchbox")).toBeFocused();
311311
}
312-
const tabs = workspace.getByRole("tab");
312+
const tabs = list.getByRole("tab");
313313
const closeButtons = workspace.getByRole("button", {
314314
name: "Close New tab tab",
315315
exact: true,
@@ -346,14 +346,14 @@ test("crowded tab strip scrolls only horizontally with Add tab fixed and a thin
346346
expect(geometry.trackHeight).toBe("4px");
347347
expect((await add.boundingBox()).x).toBeCloseTo(initial.x, 1);
348348
expect((await header.boundingBox()).height).toBeCloseTo(height, 1);
349-
await workspace.getByRole("tab").last().press("Home");
350-
await expect(workspace.getByRole("tab").first()).toBeFocused();
349+
await list.getByRole("tab").last().press("Home");
350+
await expect(list.getByRole("tab").first()).toBeFocused();
351351
await expect(closeButtons.first()).toHaveCSS("opacity", "1");
352352
await expect(list).toHaveJSProperty("scrollTop", 0);
353353
await expectTabPosition();
354354
expect((await add.boundingBox()).x).toBeCloseTo(initial.x, 1);
355-
await workspace.getByRole("tab").first().press("End");
356-
await expect(workspace.getByRole("tab").last()).toBeFocused();
355+
await list.getByRole("tab").first().press("End");
356+
await expect(list.getByRole("tab").last()).toBeFocused();
357357
await expect(list).toHaveJSProperty("scrollTop", 0);
358358
await expectTabPosition();
359359
expect((await add.boundingBox()).x).toBeCloseTo(initial.x, 1);

0 commit comments

Comments
 (0)