From e772a104c23e8d70638d601217c8c3ef64b04329 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 31 Mar 2026 13:17:57 +0100 Subject: [PATCH] Iterate --- modules/banner/element-web/e2e/banner.spec.ts | 4 ++-- modules/banner/element-web/src/index.tsx | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/banner/element-web/e2e/banner.spec.ts b/modules/banner/element-web/e2e/banner.spec.ts index fd5021e95e..edaf519492 100644 --- a/modules/banner/element-web/e2e/banner.spec.ts +++ b/modules/banner/element-web/e2e/banner.spec.ts @@ -166,8 +166,8 @@ test.describe("Banner", () => { // Verify that the #matrixchat root got shrunk to fit rather than exploding the viewport const bodyBoundingBox = await page.locator("body").boundingBox(); const rootBoundingBox = await page.locator("#matrixchat").boundingBox(); - const headerElement = await page.locator("#matrixchat").evaluate((e) => e.previousElementSibling); - const headerBoundingBox = headerElement?.getBoundingClientRect(); + const headerBoundingBox = await page.getByTestId("banner").boundingBox(); + expect(rootBoundingBox!.height).toBeLessThan(bodyBoundingBox!.height); expect(rootBoundingBox!.height + headerBoundingBox!.height).toEqual(bodyBoundingBox!.height); }); diff --git a/modules/banner/element-web/src/index.tsx b/modules/banner/element-web/src/index.tsx index f4196af06f..538fb8b3af 100644 --- a/modules/banner/element-web/src/index.tsx +++ b/modules/banner/element-web/src/index.tsx @@ -36,6 +36,7 @@ class BannerModule implements Module { } const div = document.createElement("div"); + div.dataset.testid = "banner"; this.api.rootNode.before(div); const root = this.api.createRoot(div);