Iterate
This commit is contained in:
@@ -166,8 +166,8 @@ test.describe("Banner", () => {
|
|||||||
// Verify that the #matrixchat root got shrunk to fit rather than exploding the viewport
|
// Verify that the #matrixchat root got shrunk to fit rather than exploding the viewport
|
||||||
const bodyBoundingBox = await page.locator("body").boundingBox();
|
const bodyBoundingBox = await page.locator("body").boundingBox();
|
||||||
const rootBoundingBox = await page.locator("#matrixchat").boundingBox();
|
const rootBoundingBox = await page.locator("#matrixchat").boundingBox();
|
||||||
const headerElement = await page.locator("#matrixchat").evaluate((e) => e.previousElementSibling);
|
const headerBoundingBox = await page.getByTestId("banner").boundingBox();
|
||||||
const headerBoundingBox = headerElement?.getBoundingClientRect();
|
expect(rootBoundingBox!.height).toBeLessThan(bodyBoundingBox!.height);
|
||||||
expect(rootBoundingBox!.height + headerBoundingBox!.height).toEqual(bodyBoundingBox!.height);
|
expect(rootBoundingBox!.height + headerBoundingBox!.height).toEqual(bodyBoundingBox!.height);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ class BannerModule implements Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const div = document.createElement("div");
|
const div = document.createElement("div");
|
||||||
|
div.dataset.testid = "banner";
|
||||||
this.api.rootNode.before(div);
|
this.api.rootNode.before(div);
|
||||||
|
|
||||||
const root = this.api.createRoot(div);
|
const root = this.api.createRoot(div);
|
||||||
|
|||||||
Reference in New Issue
Block a user