Skip to content

feat(auth): add end-to-end tests for sidebar layout and theme persist…#41

Merged
roble merged 2 commits into
mainfrom
feat/fe-multi-framework
Jun 4, 2026
Merged

feat(auth): add end-to-end tests for sidebar layout and theme persist…#41
roble merged 2 commits into
mainfrom
feat/fe-multi-framework

Conversation

@roble

@roble roble commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

This pull request adds comprehensive end-to-end tests for the sidebar layout and theme persistence features. The new tests ensure that key UI elements (like the tenant switcher and user menu selectors) are present and functional, and that theme selection (dark/light/system) persists correctly across navigation and between client and server.

Sidebar layout tests:

  • Added tests to verify the tenant switcher appears in the sidebar header and that the user dropdown contains language and theme selectors. Also added checks that language and theme selector submenus open as expected.

Theme persistence tests:

  • Added tests to ensure dark and light themes persist across page navigation using cookies and localStorage, that system preference for dark mode is applied before hydration, and that the correct localStorage key (appearance) and cookie are used for theme persistence.

Copilot AI review requested due to automatic review settings June 3, 2026 21:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new Playwright E2E coverage around the authenticated app shell: verifying key sidebar/user-menu affordances exist and that user-selected theme preferences persist correctly across page loads using client storage and cookies.

Changes:

  • Introduces sidebar layout smoke tests (tenant switcher visibility; language/theme selectors available and open submenus).
  • Adds theme persistence tests for dark/light/system modes and validates storage/cookie persistence behavior.
  • Verifies theme state is written to an expected localStorage key and cookie.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +56 to +58
// Navigate to another page and back — server should render class="dark" from cookie
await page.goto(page.url());


await expect(page.locator('html')).not.toHaveClass(/dark/);

await page.goto(page.url());
await expect(page.locator('html')).not.toHaveClass(/dark/);
});

test('system preference dark mode applied before hydration', async ({ page, credentials, loginAs }) => {
Comment on lines +110 to +114
await page.waitForFunction(() => document.cookie.includes('appearance=dark'));

const cookies = await page.context().cookies();
const appearanceCookie = cookies.find((c) => c.name === 'appearance');
expect(appearanceCookie?.value).toBe('dark');
@roble roble merged commit 1670f19 into main Jun 4, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants