Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
test(desktop): cover responsive app header geometry
Josuéb75a8c724ccc
diff --git a/desktop-app/test/e2e-playwright/qa-recorder-apps.spec.ts b/desktop-app/test/e2e-playwright/qa-recorder-apps.spec.tsindex af88a607a..7e92f2cf3 100644--- a/desktop-app/test/e2e-playwright/qa-recorder-apps.spec.ts+++ b/desktop-app/test/e2e-playwright/qa-recorder-apps.spec.ts@@ -78,6 +78,37 @@ test('optional QA recorder: Desktop apps journey', async ({}, testInfo) => {const mounted = backButton.or(loadingApp).or(embedPreview).first()await expect(mounted).toBeVisible({ timeout: 20_000 })+ // The app header and its notification drawer share a horizontal budget.+ // Check their rendered rectangles at the constrained desktop width so a+ // change cannot let the search overlap mounted-app controls again.+ await app.evaluate(({ BrowserWindow }) => {+ const window = BrowserWindow.getFocusedWindow() ?? BrowserWindow.getAllWindows()[0]+ if (!window || window.isDestroyed()) throw new Error('Desktop BrowserWindow closed')+ window.setContentSize(1200, 720)+ })+ const bell = page.getByTestId('notification-bell')+ await expect(bell).toBeVisible({ timeout: 20_000 })+ await bell.click()+ const drawer = page.getByRole('dialog', { name: 'Notifications and approvals' })+ const search = page.getByRole('textbox', { name: 'Search' })+ const mountedHeader = page.locator('.sandbox-ui-mounted-header')+ await expect(drawer).toBeVisible({ timeout: 20_000 })+ await expect(search).toBeVisible({ timeout: 20_000 })+ await expect(mountedHeader).toBeVisible({ timeout: 20_000 })+ const [drawerBox, searchBox, headerMetrics] = await Promise.all([+ drawer.boundingBox(),+ search.boundingBox(),+ mountedHeader.evaluate(element => ({+ clientWidth: element.clientWidth,+ scrollWidth: element.scrollWidth,+ })),+ ])+ expect(drawerBox).not.toBeNull()+ expect(searchBox).not.toBeNull()+ expect(searchBox!.width).toBeLessThanOrEqual(drawerBox!.width)+ expect(headerMetrics.scrollWidth).toBeLessThanOrEqual(headerMetrics.clientWidth)+ await bell.click()+await screenshotAndLog(page, testInfo, 'desktop-apps-embedded')// (3) Back action returns to the catalog. The Back button is part of thediff --git a/desktop-app/ui/src/pages/__tests__/SandboxUiPage.test.tsx b/desktop-app/ui/src/pages/__tests__/SandboxUiPage.test.tsxindex 61196c00a..52f70cf29 100644--- a/desktop-app/ui/src/pages/__tests__/SandboxUiPage.test.tsx+++ b/desktop-app/ui/src/pages/__tests__/SandboxUiPage.test.tsx@@ -276,6 +276,37 @@ describe('SandboxUiPage', () => {})})+ it('keeps a long conversation return label accessible after its visible text is bounded', async () => {+ const title =+ 'A deliberately long conversation title that must remain available to assistive technology'+ sandboxUi.listApps.mockResolvedValueOnce({+ apps: [+ {+ appRef: 'sandbox-recipes/sales-crm',+ title: "Andy's Sales CRM",+ defaultPath: '/',+ ready: true,+ phase: 'active',+ updatedAt: null,+ },+ ],+ })+ sandboxUi.open.mockResolvedValueOnce(undefined)++ render(+ <SandboxUiPage+ conversationOrigin={{ agentName: 'sales-agent', chatId: 'chat-123', title }}+ onBackToConversation={vi.fn()}+ />+ )++ fireEvent.click(await screen.findByRole('button', { name: "Open Andy's Sales CRM" }))+ const button = await screen.findByRole('button', { name: `Back to ${title}` })++ expect(button.getAttribute('title')).toBe(`Back to ${title}`)+ expect(button.querySelector('span')?.textContent).toBe(`Back to ${title}`)+ })+it('keeps the app mounted when returning to the conversation fails', async () => {sandboxUi.listApps.mockResolvedValueOnce({apps: [