fix: stabilize frontend — 98 TS errors to 0, align API endpoints, optimize bundle
- Fix 98 TypeScript errors across 37 files:
- Service layer double-unwrapping (subscriptionService, distributionService, gearService)
- Self-referencing variables in SearchPageResults
- FeedView/ExploreView .posts→.items alignment
- useQueueSync Zustand subscribe API
- AdminAuditLogsView missing interface fields
- Toast proxy type, interceptor type narrowing
- 22 unused imports/variables removed
- 5 storybook mock data fixes
- Align frontend API calls with backend endpoints:
- Analytics: useAnalyticsView now calls /creator/analytics/dashboard (was /analytics)
- Chat: chatService uses /conversations (was mock data), WS URL from backend token
- Dashboard StatsSection: uses real /dashboard API data (was hardcoded zeros)
- Settings: suppress 2FA toast error when endpoint unavailable
- Fix marketplace products: seed uses 'active' status (was 'published')
- Enrich seed: admin follows all creators (feed has content)
- Optimize bundle: vendor catch-all 793KB→318KB gzip (-60%)
Split into vendor-charts, vendor-emoji, vendor-swagger, vendor-media, etc.
- Clean repo: remove ~100 orphaned screenshots, audit reports, logs from root
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:18:49 +00:00
|
|
|
import { test, expect } from '@chromatic-com/playwright';
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
import { CONFIG, loginViaUI, navigateTo, assertNoDebugText } from './helpers';
|
|
|
|
|
|
|
|
|
|
test.describe('AUTH — Inscription', () => {
|
|
|
|
|
test('01. La page /register se charge correctement', async ({ page }) => {
|
|
|
|
|
await navigateTo(page, '/register');
|
|
|
|
|
await expect(page.getByTestId('register-form')).toBeVisible({ timeout: 10_000 });
|
|
|
|
|
await expect(page.locator('#register-username')).toBeVisible({ timeout: 5_000 });
|
|
|
|
|
await expect(page.locator('#register-email')).toBeVisible({ timeout: 5_000 });
|
|
|
|
|
await expect(page.locator('#register-password')).toBeVisible({ timeout: 5_000 });
|
|
|
|
|
await assertNoDebugText(page);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('02. Inscription avec email + mot de passe valides', async ({ page }) => {
|
test: update e2e test suite and add audit tests
Refine auth, player, tracks, playlists, search, workflows, edge cases,
forms, responsive, network errors, error boundary, performance, visual
regression, cross-browser, profile, smoke, storybook, chat, and session
tests. Add audit test suite (accessibility, ethical, functional, design
tokens). Update test helpers and visual snapshots.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 15:06:26 +00:00
|
|
|
test.setTimeout(60_000);
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
await navigateTo(page, '/register');
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(page.getByTestId('register-form')).toBeVisible({ timeout: 10_000 });
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
|
|
|
|
|
const uniqueSuffix = Date.now();
|
|
|
|
|
const uniqueEmail = `e2e-${uniqueSuffix}@veza.test`;
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
await page.locator('#register-username').fill(`e2e-user-${uniqueSuffix}`);
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
await page.locator('#register-email').fill(uniqueEmail);
|
|
|
|
|
await page.locator('#register-password').fill('SecurePass123!@#');
|
|
|
|
|
await page.locator('#register-password_confirm').fill('SecurePass123!@#');
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
// Accept terms
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
const termsCheckbox = page.locator('#register-terms');
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(termsCheckbox).toBeAttached({ timeout: 5_000 });
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
await termsCheckbox.click({ force: true });
|
|
|
|
|
await page.waitForTimeout(300);
|
|
|
|
|
|
|
|
|
|
const submitBtn = page.getByTestId('register-submit');
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(submitBtn).toBeVisible({ timeout: 5_000 });
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
await submitBtn.click();
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
// Must get a success indication: redirect OR verification notice
|
|
|
|
|
const successIndicator = page.getByText(/vérification|verification|email envoyé|check your email|inscription réussie/i)
|
|
|
|
|
.or(page.locator('[role="status"]').first());
|
|
|
|
|
|
|
|
|
|
await expect(
|
|
|
|
|
successIndicator.first(),
|
|
|
|
|
).toBeVisible({ timeout: 20_000 });
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
});
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
test('03. Inscription avec email deja existant -> erreur claire', async ({ page }) => {
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
await navigateTo(page, '/register');
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(page.getByTestId('register-form')).toBeVisible({ timeout: 10_000 });
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
|
|
|
|
|
await page.locator('#register-username').fill('duplicate-user');
|
|
|
|
|
await page.locator('#register-email').fill(CONFIG.users.listener.email);
|
|
|
|
|
await page.locator('#register-password').fill('SecurePass123!@#');
|
|
|
|
|
await page.locator('#register-password_confirm').fill('SecurePass123!@#');
|
|
|
|
|
|
|
|
|
|
const termsCheckbox = page.locator('#register-terms');
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(termsCheckbox).toBeAttached({ timeout: 5_000 });
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
await termsCheckbox.click({ force: true });
|
|
|
|
|
await page.waitForTimeout(300);
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
await page.getByTestId('register-submit').click();
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
// Must show an error — not silently succeed
|
|
|
|
|
const errorIndicator = page.getByRole('alert')
|
|
|
|
|
.or(page.getByText(/existe déjà|already exists|email.*taken/i));
|
|
|
|
|
await expect(errorIndicator.first()).toBeVisible({ timeout: 10_000 });
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
});
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
test('04. Validation cote client — mot de passe trop court', async ({ page }) => {
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
await navigateTo(page, '/register');
|
|
|
|
|
|
|
|
|
|
await page.locator('#register-password').fill('123');
|
|
|
|
|
await page.locator('#register-password').press('Tab');
|
|
|
|
|
await page.waitForTimeout(500);
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
// Also submit to trigger validation
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
await page.locator('#register-email').fill('valid@test.com');
|
|
|
|
|
await page.locator('#register-username').fill('testuser');
|
|
|
|
|
await page.locator('#register-password_confirm').fill('123');
|
|
|
|
|
await page.getByTestId('register-submit').click();
|
|
|
|
|
await page.waitForTimeout(500);
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
// Must display a validation error
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
const errorMsg = page.locator('#register-password-error')
|
|
|
|
|
.or(page.getByRole('alert'))
|
|
|
|
|
.or(page.getByText(/trop court|too short|minimum|au moins|at least|caractères|doit contenir/i));
|
|
|
|
|
await expect(errorMsg.first()).toBeVisible({ timeout: 5_000 });
|
|
|
|
|
});
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
test('05. Validation cote client — email invalide', async ({ page }) => {
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
await navigateTo(page, '/register');
|
|
|
|
|
|
|
|
|
|
await page.locator('#register-email').fill('not-an-email');
|
|
|
|
|
await page.locator('#register-email').blur();
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(
|
|
|
|
|
page.getByText(/email.*invalide|invalid.*email|format/i),
|
|
|
|
|
).toBeVisible({ timeout: 3_000 });
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test.describe('AUTH — Connexion', () => {
|
|
|
|
|
test('06. La page /login se charge correctement', async ({ page }) => {
|
|
|
|
|
await navigateTo(page, '/login');
|
|
|
|
|
await expect(page.getByTestId('login-form')).toBeVisible({ timeout: 10_000 });
|
|
|
|
|
await expect(page.getByTestId('login-submit')).toBeVisible({ timeout: 5_000 });
|
|
|
|
|
await assertNoDebugText(page);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('07. Connexion avec identifiants valides @critical', async ({ page }) => {
|
|
|
|
|
await loginViaUI(page, CONFIG.users.listener.email, CONFIG.users.listener.password);
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
// Must not be on /login anymore
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
await expect(page).not.toHaveURL(/login/);
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
// Authenticated layout must be visible
|
|
|
|
|
await expect(page.getByTestId('app-sidebar')).toBeVisible({ timeout: 5_000 });
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
});
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
test('08. Connexion avec mauvais mot de passe -> erreur claire', async ({ page }) => {
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
test.setTimeout(60_000);
|
|
|
|
|
await navigateTo(page, '/login');
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(page.getByTestId('login-form')).toBeVisible({ timeout: 10_000 });
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
|
|
|
|
|
const emailInput = page.locator('input[type="email"]');
|
|
|
|
|
await emailInput.clear();
|
|
|
|
|
await emailInput.fill(CONFIG.users.listener.email);
|
|
|
|
|
const passwordInput = page.locator('input[type="password"]').first();
|
|
|
|
|
await passwordInput.clear();
|
|
|
|
|
await passwordInput.fill('WrongPassword123!');
|
|
|
|
|
await page.getByTestId('login-submit').click();
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
// Must show error AND stay on /login
|
|
|
|
|
const errorIndicator = page.getByRole('alert')
|
|
|
|
|
.or(page.getByText(/incorrect|invalid|erreur|error|identifiants/i));
|
|
|
|
|
await expect(errorIndicator.first()).toBeVisible({ timeout: 15_000 });
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
await expect(page).toHaveURL(/login/);
|
|
|
|
|
});
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
test('09. Lien mot de passe oublie fonctionne', async ({ page }) => {
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
await navigateTo(page, '/login');
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(page.getByTestId('login-form')).toBeVisible({ timeout: 10_000 });
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
|
|
|
|
|
const forgotLink = page.getByRole('link', { name: /forgot password/i })
|
|
|
|
|
.or(page.locator('a[href="/forgot-password"]'));
|
|
|
|
|
await expect(forgotLink.first()).toBeVisible({ timeout: 8_000 });
|
|
|
|
|
await forgotLink.first().click();
|
|
|
|
|
|
|
|
|
|
await expect(page).toHaveURL(/forgot-password/, { timeout: 10_000 });
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('10. Lien vers inscription depuis la page login', async ({ page }) => {
|
|
|
|
|
await navigateTo(page, '/login');
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(page.getByTestId('login-form')).toBeVisible({ timeout: 10_000 });
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
|
|
|
|
|
const registerLink = page.getByRole('link', { name: /sign up/i })
|
|
|
|
|
.or(page.locator('a[href="/register"]'));
|
|
|
|
|
await expect(registerLink.first()).toBeVisible({ timeout: 8_000 });
|
|
|
|
|
await registerLink.first().click();
|
|
|
|
|
|
|
|
|
|
await expect(page).toHaveURL(/register/, { timeout: 10_000 });
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
test.describe('AUTH — Sessions et securite', () => {
|
|
|
|
|
test('11. Redirection vers /login si non authentifie @critical', async ({ page }) => {
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
test.setTimeout(60_000);
|
|
|
|
|
await page.goto('/dashboard', { waitUntil: 'domcontentloaded' });
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
// Must redirect to login
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
await expect(page).toHaveURL(/login/, { timeout: 20_000 });
|
|
|
|
|
});
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
test('12. L\'utilisateur est authentifie apres connexion (auth-storage)', async ({ page }) => {
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
test.setTimeout(60_000);
|
|
|
|
|
await loginViaUI(page, CONFIG.users.listener.email, CONFIG.users.listener.password);
|
|
|
|
|
|
|
|
|
|
// Verify isAuthenticated is true in the Zustand auth-storage
|
|
|
|
|
const isAuthenticated = await page.evaluate(() => {
|
|
|
|
|
const raw = localStorage.getItem('auth-storage');
|
|
|
|
|
if (!raw) return false;
|
|
|
|
|
try {
|
|
|
|
|
const parsed = JSON.parse(raw);
|
|
|
|
|
return parsed?.state?.isAuthenticated === true;
|
|
|
|
|
} catch {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
expect(isAuthenticated, 'auth-storage should have isAuthenticated=true after login').toBeTruthy();
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
});
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
test('13. Deconnexion fonctionne correctement', async ({ page }) => {
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
test.setTimeout(60_000);
|
|
|
|
|
await loginViaUI(page, CONFIG.users.listener.email, CONFIG.users.listener.password);
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
// Find and click sign out — try header menu first, then sidebar
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
const userMenu = page.getByTestId('user-menu');
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(userMenu).toBeVisible({ timeout: 5_000 });
|
|
|
|
|
await userMenu.click();
|
|
|
|
|
await page.waitForTimeout(800);
|
|
|
|
|
|
|
|
|
|
const signOutBtn = page.locator('button.text-destructive').first()
|
|
|
|
|
.or(page.locator('button').filter({ hasText: /sign out|déconnexion|logout/i }).first());
|
|
|
|
|
await expect(signOutBtn).toBeVisible({ timeout: 3_000 });
|
|
|
|
|
await signOutBtn.click();
|
|
|
|
|
|
|
|
|
|
// Must redirect to /login
|
|
|
|
|
await expect(page).toHaveURL(/login/, { timeout: 20_000 });
|
|
|
|
|
|
|
|
|
|
// Auth state must be cleared
|
|
|
|
|
const isAuthenticated = await page.evaluate(() => {
|
test: update e2e test suite and add audit tests
Refine auth, player, tracks, playlists, search, workflows, edge cases,
forms, responsive, network errors, error boundary, performance, visual
regression, cross-browser, profile, smoke, storybook, chat, and session
tests. Add audit test suite (accessibility, ethical, functional, design
tokens). Update test helpers and visual snapshots.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 15:06:26 +00:00
|
|
|
const raw = localStorage.getItem('auth-storage');
|
|
|
|
|
if (!raw) return false;
|
2026-04-02 17:42:03 +00:00
|
|
|
try {
|
|
|
|
|
return JSON.parse(raw)?.state?.isAuthenticated === true;
|
|
|
|
|
} catch {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
test: update e2e test suite and add audit tests
Refine auth, player, tracks, playlists, search, workflows, edge cases,
forms, responsive, network errors, error boundary, performance, visual
regression, cross-browser, profile, smoke, storybook, chat, and session
tests. Add audit test suite (accessibility, ethical, functional, design
tokens). Update test helpers and visual snapshots.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 15:06:26 +00:00
|
|
|
});
|
2026-04-02 17:42:03 +00:00
|
|
|
expect(isAuthenticated, 'auth-storage should be cleared after logout').toBeFalsy();
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('14. Protection CSRF — la page login charge sans erreur CSRF', async ({ page }) => {
|
|
|
|
|
await navigateTo(page, '/login');
|
|
|
|
|
|
|
|
|
|
const body = await page.textContent('body') || '';
|
|
|
|
|
expect(body).not.toMatch(/csrf.*error|forbidden/i);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test.describe('AUTH — OAuth', () => {
|
|
|
|
|
test('15. Boutons OAuth visibles sur la page login', async ({ page }) => {
|
|
|
|
|
await navigateTo(page, '/login');
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
// At least one OAuth provider button must be visible
|
|
|
|
|
const oauthBtn = page.getByRole('button', { name: /google|github|discord|spotify/i }).first()
|
|
|
|
|
.or(page.locator('[data-provider]').first())
|
|
|
|
|
.or(page.locator('a[href*="oauth"]').first());
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(oauthBtn).toBeVisible({ timeout: 5_000 });
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
});
|
|
|
|
|
});
|