feat: Implement sidebar toggle functionality and enhance Monthly Timesheet summary view
This commit is contained in:
parent
cab549ab3a
commit
a7f8dfba01
13 changed files with 686 additions and 58 deletions
|
|
@ -1,5 +1,30 @@
|
|||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test.describe('sidebar collapse', () => {
|
||||
test('starts collapsed and expands through the toggle button', async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1440, height: 960 });
|
||||
await page.goto('/');
|
||||
|
||||
const sidebar = page.getByTestId('sidebar-shell');
|
||||
const toggle = page.getByRole('button', { name: 'Toggle sidebar' });
|
||||
|
||||
await expect(sidebar).toHaveAttribute('data-collapsed', 'true');
|
||||
await expect(toggle).toHaveAttribute('aria-expanded', 'false');
|
||||
await expect(page.getByRole('link', { name: 'Dashboard' })).toBeVisible();
|
||||
|
||||
await toggle.click();
|
||||
|
||||
await expect(sidebar).toHaveAttribute('data-collapsed', 'false');
|
||||
await expect(toggle).toHaveAttribute('aria-expanded', 'true');
|
||||
await expect(page.getByText('Dashboard')).toBeVisible();
|
||||
|
||||
await toggle.click();
|
||||
|
||||
await expect(sidebar).toHaveAttribute('data-collapsed', 'true');
|
||||
await expect(toggle).toHaveAttribute('aria-expanded', 'false');
|
||||
});
|
||||
});
|
||||
|
||||
test('home loads without a login screen', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
|
||||
|
|
@ -14,7 +39,7 @@ test('protected pages are directly available without redirecting to login', asyn
|
|||
{ path: '/calendar', heading: 'Calendar' },
|
||||
{ path: '/summary', heading: 'Monthly Summary' },
|
||||
{ path: '/settings', heading: 'Settings' },
|
||||
{ path: '/workday', heading: 'Work Day Entry' },
|
||||
{ path: '/work-unit', heading: 'Work Unit' },
|
||||
{ path: '/auth', heading: 'You are authenticated' }
|
||||
];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue