Skip to content

Commit 38544d3

Browse files
committed
test(ui): observe renewed dashboard frame before sampling colors
1 parent cc9bc43 commit 38544d3

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

‎ui/src/e2e/board-mcp-app.e2e.test.ts‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,16 @@ describeControlUiE2e("Control UI dashboard MCP Apps", () => {
243243
await openDashboard(page);
244244
await expect
245245
.poll(async () => (await gateway.getRequests("board.widget.appView")).length, {
246-
timeout: 10_000,
246+
timeout: 15_000,
247247
})
248-
.toBeGreaterThan(0);
248+
.toBe(2);
249+
// Renewal replaces the iframe. The new-binding request follows teardown,
250+
// so wait for it before sampling the replacement's rendered background.
251+
await expect
252+
.poll(async () =>
253+
(await gateway.getRequests("mcp.app.view")).map((request) => request.params),
254+
)
255+
.toContainEqual({ sessionKey, viewId: "renewed-view" });
249256
await waitForMountedApp(page);
250257
const widgetBackgrounds = await page.evaluate(() => {
251258
const widgetElement = document.querySelector<HTMLElement>('[data-test-id="board-widget"]');
@@ -262,11 +269,6 @@ describeControlUiE2e("Control UI dashboard MCP Apps", () => {
262269
});
263270
expect(widgetBackgrounds.frame).toBe(widgetBackgrounds.widget);
264271
expect(widgetBackgrounds.frame).not.toBe("rgba(0, 0, 0, 0)");
265-
await expect
266-
.poll(async () => (await gateway.getRequests("board.widget.appView")).length, {
267-
timeout: 15_000,
268-
})
269-
.toBe(2);
270272
expect((await gateway.getRequests("board.widget.appView"))[0]?.params).toEqual({
271273
sessionKey,
272274
name: "app-0",

0 commit comments

Comments
 (0)