Skip to content

Commit 04446c4

Browse files
committed
Make protein render check portable
1 parent 820af5c commit 04446c4

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

frontend/e2e/viewer.spec.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,9 +1113,18 @@ test("fits and exports a publication Ribbon for 1CRN", async ({ page }) => {
11131113
})).toHaveAttribute("aria-pressed", "true");
11141114
await page.getByRole("button", { name: "Close", exact: true }).click();
11151115

1116+
await expect(canvas).toHaveAttribute("data-representation", "ribbon", {
1117+
timeout: 30_000,
1118+
});
11161119
await expect.poll(
1117-
async () => contentMetrics(await sceneScreenshot(page, canvas)).changed,
1118-
).toBeGreaterThan(20_000);
1120+
async () => {
1121+
const bounds = contentMetrics(await sceneScreenshot(page, canvas)).bounds;
1122+
return bounds
1123+
? Math.min(bounds.right - bounds.left + 1, bounds.bottom - bounds.top + 1)
1124+
: 0;
1125+
},
1126+
{ timeout: 30_000 },
1127+
).toBeGreaterThan(140);
11191128
await page.getByRole("toolbar", {
11201129
name: "Camera controls",
11211130
}).getByRole("button", {

0 commit comments

Comments
 (0)