diff --git a/tests/e2e/tests/sidebar.spec.ts b/tests/e2e/tests/sidebar.spec.ts index 804a2e6..ab35f26 100644 --- a/tests/e2e/tests/sidebar.spec.ts +++ b/tests/e2e/tests/sidebar.spec.ts @@ -21,6 +21,46 @@ test.describe.parallel('Sidebar layout', () => { ).toBeVisible(); }); + // An app with no main or bottom links (a template's) must not keep their padded, + // empty groups: they push the next block down for nothing. + test('renders no empty menu groups', async ({ + page, + credentials, + loginAs, + }) => { + await loginAs(credentials.user); + await page.goto('/dashboard'); + await expectAuthenticated(page); + + await expect( + page.locator( + '[data-sidebar="content"] [data-slot="sidebar-menu"]:empty', + ), + ).toHaveCount(0); + }); + + // Resizing is a page's choice (AppLayout's `resizable`, which the chat turns on); the + // dashboard keeps the default width. Dragging, the keys and the limits are covered by + // core's Layout/AppLayout stories. + test('the dashboard sidebar has no resize handle', async ({ + page, + credentials, + loginAs, + }) => { + await loginAs(credentials.user); + await page.goto('/dashboard'); + await expectAuthenticated(page); + // A template may send the dashboard to a page of its own (the chat template: to the + // chat, whose sidebar resizes): that page is the template's to test. Tenancy's path + // mode keeps it a dashboard, under the workspace (`/w//dashboard`). + test.skip( + !new URL(page.url()).pathname.endsWith('/dashboard'), + 'the dashboard is replaced by a template page', + ); + + await expect(page.getByTestId('sidebar-resize')).toHaveCount(0); + }); + test('theme selector submenu opens', async ({ page, credentials,