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 { loginViaAPI, CONFIG, navigateTo } from './helpers';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* UPLOAD - Track upload flow tests
|
2026-04-02 17:42:03 +00:00
|
|
|
* STRICT: every step must succeed or the test fails.
|
|
|
|
|
* No silent skips, no console.log fallbacks.
|
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
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
function createTestMP3Buffer(): Buffer {
|
|
|
|
|
return Buffer.from(
|
|
|
|
|
'4944330300000000000a544954320000000500000054657374fffb90440000000000000000000000000000000000000000',
|
|
|
|
|
'hex',
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
test.describe('UPLOAD - Track upload flow @critical', () => {
|
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
|
|
|
await loginViaAPI(page, CONFIG.users.creator.email, CONFIG.users.creator.password);
|
|
|
|
|
});
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
test('should show upload button on library page', 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, '/library');
|
|
|
|
|
|
|
|
|
|
const uploadBtn = page.getByRole('button', { name: /upload|uploader/i }).first();
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(uploadBtn, 'Upload button must be visible on /library').toBeVisible({ timeout: 10_000 });
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('should open upload modal when clicking upload button', async ({ page }) => {
|
|
|
|
|
await navigateTo(page, '/library');
|
|
|
|
|
|
|
|
|
|
const uploadBtn = page.getByRole('button', { name: /upload|uploader/i }).first();
|
|
|
|
|
await expect(uploadBtn).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 uploadBtn.click();
|
|
|
|
|
|
|
|
|
|
const dialog = page.locator('[role="dialog"]').first();
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(dialog, 'Upload dialog must appear after clicking upload').toBeVisible({ timeout: 5_000 });
|
|
|
|
|
|
|
|
|
|
// Dialog must contain a file input
|
|
|
|
|
const fileInput = dialog.locator('input[type="file"]');
|
|
|
|
|
expect(await fileInput.count(), 'File input must exist in upload dialog').toBeGreaterThan(0);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('should complete full upload flow: file, metadata, publish @critical', async ({ page }) => {
|
|
|
|
|
test.setTimeout(120_000);
|
|
|
|
|
await navigateTo(page, '/library');
|
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
|
|
|
// Step 1: Open upload modal
|
|
|
|
|
const uploadBtn = page.getByRole('button', { name: /upload|uploader/i }).first();
|
|
|
|
|
await expect(uploadBtn).toBeVisible({ timeout: 10_000 });
|
|
|
|
|
await uploadBtn.click();
|
|
|
|
|
|
|
|
|
|
const dialog = page.locator('[role="dialog"]').first();
|
|
|
|
|
await expect(dialog).toBeVisible({ timeout: 5_000 });
|
|
|
|
|
|
|
|
|
|
// Step 2: Set file
|
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 fileInput = dialog.locator('input[type="file"]').first();
|
2026-04-02 17:42:03 +00:00
|
|
|
expect(await fileInput.count(), 'File input must exist').toBeGreaterThan(0);
|
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
|
|
|
const uniqueTitle = `E2E Upload ${Date.now()}`;
|
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 fileInput.setInputFiles({
|
|
|
|
|
name: 'test-track.mp3',
|
|
|
|
|
mimeType: 'audio/mpeg',
|
|
|
|
|
buffer: createTestMP3Buffer(),
|
|
|
|
|
});
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
// Step 3: Fill metadata — title input must appear after file is processed
|
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 titleInput = dialog.locator('#title').or(dialog.locator('input[name="title"]'));
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(titleInput, 'Title input must appear after file upload').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 titleInput.fill(uniqueTitle);
|
|
|
|
|
|
|
|
|
|
const artistInput = dialog.locator('#artist').or(dialog.locator('input[name="artist"]'));
|
2026-04-02 17:42:03 +00:00
|
|
|
if (await artistInput.isVisible({ timeout: 2_000 }).catch(() => false)) {
|
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 artistInput.fill('E2E Test Artist');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const genreInput = dialog.locator('#genre').or(dialog.locator('input[name="genre"]'));
|
2026-04-02 17:42:03 +00:00
|
|
|
if (await genreInput.isVisible({ timeout: 2_000 }).catch(() => false)) {
|
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 genreInput.fill('Electronic');
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
// Step 4: Submit
|
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 submitBtn = dialog.locator('button[type="submit"]')
|
|
|
|
|
.or(dialog.locator('button[form="upload-track-form"]'))
|
|
|
|
|
.or(dialog.getByRole('button', { name: /uploader/i }));
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(submitBtn, 'Submit button must be visible').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
|
|
|
await submitBtn.click();
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
// Step 5: Wait for upload to complete — dialog must close or show success
|
|
|
|
|
await expect(dialog, 'Upload dialog must close after successful upload').not.toBeVisible({ timeout: 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
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
// Step 6: Verify track appears in library
|
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, '/library');
|
2026-04-02 17:42:03 +00:00
|
|
|
await page.waitForTimeout(2_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 trackInLibrary = page.locator(`text=${uniqueTitle}`).first();
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(
|
|
|
|
|
trackInLibrary,
|
|
|
|
|
`Uploaded track "${uniqueTitle}" must be visible in library`,
|
|
|
|
|
).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
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('should show error for invalid file format', async ({ page }) => {
|
|
|
|
|
await navigateTo(page, '/library');
|
|
|
|
|
|
|
|
|
|
const uploadBtn = page.getByRole('button', { name: /upload|uploader/i }).first();
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(uploadBtn).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 uploadBtn.click();
|
|
|
|
|
|
|
|
|
|
const dialog = page.locator('[role="dialog"]').first();
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(dialog).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
|
|
|
|
|
|
|
|
const fileInput = dialog.locator('input[type="file"]').first();
|
2026-04-02 17:42:03 +00:00
|
|
|
expect(await fileInput.count()).toBeGreaterThan(0);
|
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
|
|
|
// Upload a text file — must be rejected
|
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 fileInput.setInputFiles({
|
|
|
|
|
name: 'invalid.txt',
|
|
|
|
|
mimeType: 'text/plain',
|
|
|
|
|
buffer: Buffer.from('This is not an audio file'),
|
|
|
|
|
});
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
await page.waitForTimeout(1_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
|
|
|
// Either: error message appears, OR dropzone is still shown (file was rejected silently)
|
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 = dialog.locator('text=/format|invalid|non supporté|rejected/i').first();
|
|
|
|
|
const dropzoneStillVisible = dialog.locator('text=/glissez|drag|drop/i').first();
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
const hasError = await errorMsg.isVisible({ timeout: 3_000 }).catch(() => false);
|
|
|
|
|
const dropzoneBack = await dropzoneStillVisible.isVisible({ timeout: 3_000 }).catch(() => false);
|
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
|
|
|
expect(
|
|
|
|
|
hasError || dropzoneBack,
|
|
|
|
|
'Invalid file must be rejected: error message or dropzone should remain',
|
|
|
|
|
).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('should disable submit button when no file is selected', 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, '/library');
|
|
|
|
|
|
|
|
|
|
const uploadBtn = page.getByRole('button', { name: /upload|uploader/i }).first();
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(uploadBtn).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 uploadBtn.click();
|
|
|
|
|
|
|
|
|
|
const dialog = page.locator('[role="dialog"]').first();
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(dialog).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
|
|
|
// Submit button should either not exist yet (no file) or be disabled
|
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 submitBtn = dialog.locator('button[type="submit"]')
|
|
|
|
|
.or(dialog.locator('button[form="upload-track-form"]'))
|
|
|
|
|
.or(dialog.getByRole('button', { name: /uploader/i }));
|
|
|
|
|
|
2026-04-02 17:42:03 +00:00
|
|
|
const isVisible = await submitBtn.isVisible({ timeout: 3_000 }).catch(() => false);
|
|
|
|
|
if (isVisible) {
|
|
|
|
|
await expect(submitBtn, 'Submit button must be disabled when no file is selected').toBeDisabled();
|
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
|
|
|
// If submit button is not visible at all (only appears after file selection), that's also correct
|
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('should close modal with Escape key', 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, '/library');
|
|
|
|
|
|
|
|
|
|
const uploadBtn = page.getByRole('button', { name: /upload|uploader/i }).first();
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(uploadBtn).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 uploadBtn.click();
|
|
|
|
|
|
|
|
|
|
const dialog = page.locator('[role="dialog"]').first();
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(dialog).toBeVisible({ timeout: 5_000 });
|
|
|
|
|
|
|
|
|
|
// Close via Escape
|
|
|
|
|
await page.keyboard.press('Escape');
|
|
|
|
|
await expect(dialog, 'Dialog must close after pressing Escape').not.toBeVisible({ timeout: 3_000 });
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('should close modal with close button', async ({ page }) => {
|
|
|
|
|
await navigateTo(page, '/library');
|
|
|
|
|
|
|
|
|
|
const uploadBtn = page.getByRole('button', { name: /upload|uploader/i }).first();
|
|
|
|
|
await expect(uploadBtn).toBeVisible({ timeout: 10_000 });
|
|
|
|
|
await uploadBtn.click();
|
|
|
|
|
|
|
|
|
|
const dialog = page.locator('[role="dialog"]').first();
|
|
|
|
|
await expect(dialog).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
|
|
|
|
|
|
|
|
// Close via button
|
|
|
|
|
const closeBtn = dialog.getByRole('button', { name: /close|cancel|fermer|annuler/i }).first();
|
2026-04-02 17:42:03 +00:00
|
|
|
await expect(closeBtn, 'Close/Cancel button must exist in dialog').toBeVisible({ timeout: 3_000 });
|
|
|
|
|
await closeBtn.click();
|
|
|
|
|
await expect(dialog, 'Dialog must close after clicking close button').not.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
|
|
|
});
|
|
|
|
|
});
|