Skip to content

Commit f4d4f83

Browse files
committed
Relax persona catalog scroll assertion
1 parent 0286f4a commit f4d4f83

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

desktop/tests/e2e/agents.spec.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,16 @@ test("built-in personas are chosen from the dialog and can be selected", async (
159159
await expect(
160160
page.getByTestId("persona-catalog-dialog-scroll-area"),
161161
).toHaveCSS("overflow-y", "auto");
162-
expect(
163-
await page
164-
.getByTestId("persona-catalog-dialog-scroll-area")
165-
.evaluate(
166-
(element) =>
167-
element.scrollHeight > element.clientHeight &&
168-
element.clientHeight > 0,
169-
),
170-
).toBe(true);
162+
const catalogScrollAreaMetrics = await page
163+
.getByTestId("persona-catalog-dialog-scroll-area")
164+
.evaluate((element) => ({
165+
clientHeight: element.clientHeight,
166+
scrollHeight: element.scrollHeight,
167+
}));
168+
expect(catalogScrollAreaMetrics.clientHeight).toBeGreaterThan(0);
169+
expect(catalogScrollAreaMetrics.scrollHeight).toBeGreaterThanOrEqual(
170+
catalogScrollAreaMetrics.clientHeight,
171+
);
171172
await expect(page.getByTestId("persona-catalog-dialog-footer")).toBeVisible();
172173
await expect(page.getByRole("tooltip")).toHaveCount(0);
173174
const initialCatalogOrder = await getCatalogOrder(page);

0 commit comments

Comments
 (0)