Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions tests/e2e/tests/sidebar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/<slug>/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,
Expand Down