veza/tests/e2e/audit/interaction/05-drag-drop.spec.ts
senke 6fad0ad68d 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 21:18:49 +01:00

43 lines
1.8 KiB
TypeScript

import { test, expect } from '@chromatic-com/playwright';
import { loginViaAPI, navigateTo } from '../helpers';
import { TEST_USERS } from '../design-tokens';
test.describe('DRAG & DROP — Réordonner les playlists et éléments', () => {
test.beforeEach(async ({ page }) => {
await loginViaAPI(page, TEST_USERS.listener.email, TEST_USERS.listener.password);
});
test('Playlists — la page de détail charge sans erreur', async ({ page }) => {
await navigateTo(page, '/playlists');
// Chercher une playlist existante
const playlistLink = page.locator('a[href*="/playlists/"]').first();
if (await playlistLink.isVisible({ timeout: 5_000 }).catch(() => false)) {
await playlistLink.click();
await page.waitForLoadState('networkidle').catch(() => {});
// La page de détail devrait charger
const body = await page.textContent('body') || '';
expect(body).not.toMatch(/500|Internal Server Error/i);
expect(body.length).toBeGreaterThan(50);
// Vérifier la présence d'éléments draggable
const draggableItems = await page.locator('[draggable="true"], [data-rbd-draggable-id], [class*="drag"]').count();
console.log(`[DRAG] ${draggableItems} éléments draggable trouvés dans la playlist`);
} else {
console.log('[DRAG] Pas de playlist existante — test non applicable');
}
});
test('Queue — la page de queue charge et affiche la file d\'attente', async ({ page }) => {
await navigateTo(page, '/queue');
const body = await page.textContent('body') || '';
expect(body).not.toMatch(/500|Internal Server Error/i);
// La queue peut être vide, vérifier qu'un empty state ou des tracks sont affichés
const hasContent = body.length > 100;
expect(hasContent, 'La page queue est vide').toBe(true);
});
});