Files
stack/apps/web/e2e/settings.spec.ts
Jason Woltje cb92ba16c1
Some checks failed
ci/woodpecker/push/ci Pipeline failed
feat(web): Playwright E2E test suite for critical paths (#152)
Co-authored-by: Jason Woltje <jason@diversecanvas.com>
Co-committed-by: Jason Woltje <jason@diversecanvas.com>
2026-03-15 19:46:13 +00:00

57 lines
2.1 KiB
TypeScript

import { test, expect } from '@playwright/test';
import { loginAs, TEST_USER } from './helpers/auth.js';
test.describe('Settings page', () => {
test.beforeEach(async ({ page }) => {
await loginAs(page, TEST_USER.email, TEST_USER.password);
const url = page.url();
test.skip(!url.includes('/chat'), 'No seeded test user — skipping authenticated tests');
});
test('settings page loads with heading', async ({ page }) => {
await page.goto('/settings');
await expect(page.getByRole('heading', { name: /^settings$/i })).toBeVisible({
timeout: 10_000,
});
});
test('shows the four settings tabs', async ({ page }) => {
await page.goto('/settings');
await expect(page.getByRole('button', { name: /profile/i })).toBeVisible();
await expect(page.getByRole('button', { name: /appearance/i })).toBeVisible();
await expect(page.getByRole('button', { name: /notifications/i })).toBeVisible();
await expect(page.getByRole('button', { name: /providers/i })).toBeVisible();
});
test('profile tab is active by default', async ({ page }) => {
await page.goto('/settings');
await expect(page.getByRole('heading', { name: /^profile$/i })).toBeVisible({
timeout: 10_000,
});
});
test('clicking Appearance tab switches content', async ({ page }) => {
await page.goto('/settings');
await page.getByRole('button', { name: /appearance/i }).click();
await expect(page.getByRole('heading', { name: /appearance/i })).toBeVisible({
timeout: 5_000,
});
});
test('clicking Notifications tab switches content', async ({ page }) => {
await page.goto('/settings');
await page.getByRole('button', { name: /notifications/i }).click();
await expect(page.getByRole('heading', { name: /notifications/i })).toBeVisible({
timeout: 5_000,
});
});
test('clicking Providers tab switches content', async ({ page }) => {
await page.goto('/settings');
await page.getByRole('button', { name: /providers/i }).click();
await expect(page.getByRole('heading', { name: /llm providers/i })).toBeVisible({
timeout: 5_000,
});
});
});