Skip to content

Commit 864ea60

Browse files
committed
Tie nav spacing test to Tailwind padding
1 parent 7d59b30 commit 864ea60

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

desktop/tests/e2e/messaging.spec.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -802,9 +802,13 @@ test("narrow thread view collapses channel header actions into a menu", async ({
802802
if (!menuBox || !threadPanelBox) {
803803
throw new Error("Expected header action menu and thread panel bounds");
804804
}
805-
const menuGapPx = threadPanelBox.x - (menuBox.x + menuBox.width);
806-
expect(menuGapPx).toBeGreaterThanOrEqual(10);
807-
expect(menuGapPx).toBeLessThanOrEqual(14);
805+
const menuGap = threadPanelBox.x - (menuBox.x + menuBox.width);
806+
const headerPaddingInlineEnd = await page
807+
.getByTestId("chat-header")
808+
.evaluate((header) =>
809+
Number.parseFloat(window.getComputedStyle(header).paddingRight),
810+
);
811+
expect(Math.round(menuGap)).toBe(Math.round(headerPaddingInlineEnd));
808812

809813
await menuTrigger.click();
810814

0 commit comments

Comments
 (0)