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: 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
|
|
|
import { loginViaAPI, navigateTo, assertNotBroken, assertNoDebugText } from '../helpers';
|
|
|
|
|
import { TEST_USERS, ROUTES } from '../design-tokens';
|
|
|
|
|
|
|
|
|
|
test.describe('FONCTIONNEL — Pages Admin', () => {
|
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
|
|
|
await loginViaAPI(page, TEST_USERS.admin.email, TEST_USERS.admin.password);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
for (const route of ROUTES.admin) {
|
|
|
|
|
test(`${route.name} (${route.path}) — se charge sans crash`, async ({ page }) => {
|
|
|
|
|
await navigateTo(page, route.path);
|
|
|
|
|
await assertNotBroken(page);
|
|
|
|
|
await assertNoDebugText(page);
|
|
|
|
|
|
|
|
|
|
const main = page.locator('main, [role="main"]').first();
|
|
|
|
|
await expect(main).toBeVisible({ timeout: 15_000 });
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|