fix(tests): cycles 12–18 – corrections services, mocks et design tokens
- chatService: getChannels → getServers
- commerceService: getOrders/getOrderDetails/getSalesStats → getPurchases/getSellerStats
- marketplaceService: mock réponse, params API, getDownloadLink → listOrders
- config/env.test: vi.stubEnv, import dynamique
- useAuth.test: mock useAuthStore
- TrackStatsDisplay, UploadQuota: mock du bon service (analyticsService, uploadService)
- TrackListEmpty, TrackListRow, TrackSearch: design tokens, assertions
- trackDownloadService, chunkedUploadService: MSW/server.use
- trackListService, trackSearchService, trackShareService: assertions
- ErrorBoundary, LoginForm, PlaylistErrorBoundary, PlaylistRecommendations
- RAPPORT_RESOLUTION_TESTS_CYCLE1.md
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 08:43:55 +00:00
|
|
|
import { defineConfig, configDefaults } from 'vitest/config';
|
2025-12-03 21:56:50 +00:00
|
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
|
import path from 'path';
|
2026-02-02 18:34:14 +00:00
|
|
|
import { fileURLToPath } from 'node:url';
|
2026-02-12 22:12:35 +00:00
|
|
|
// Storybook test plugin — uncomment storybookTest and the browser project below
|
|
|
|
|
// to run story-based visual tests (requires Playwright to be installed).
|
2026-02-03 08:37:16 +00:00
|
|
|
// import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
|
2026-02-02 18:34:14 +00:00
|
|
|
const dirname =
|
|
|
|
|
typeof __dirname !== 'undefined'
|
|
|
|
|
? __dirname
|
|
|
|
|
: path.dirname(fileURLToPath(import.meta.url));
|
2025-12-03 21:56:50 +00:00
|
|
|
|
2026-02-02 18:34:14 +00:00
|
|
|
// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
|
2025-12-03 21:56:50 +00:00
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [react()],
|
|
|
|
|
test: {
|
|
|
|
|
globals: true,
|
|
|
|
|
environment: 'jsdom',
|
|
|
|
|
setupFiles: ['./src/test/setup.ts', './src/mocks/test-setup.ts'],
|
fix(tests): cycles 12–18 – corrections services, mocks et design tokens
- chatService: getChannels → getServers
- commerceService: getOrders/getOrderDetails/getSalesStats → getPurchases/getSellerStats
- marketplaceService: mock réponse, params API, getDownloadLink → listOrders
- config/env.test: vi.stubEnv, import dynamique
- useAuth.test: mock useAuthStore
- TrackStatsDisplay, UploadQuota: mock du bon service (analyticsService, uploadService)
- TrackListEmpty, TrackListRow, TrackSearch: design tokens, assertions
- trackDownloadService, chunkedUploadService: MSW/server.use
- trackListService, trackSearchService, trackShareService: assertions
- ErrorBoundary, LoginForm, PlaylistErrorBoundary, PlaylistRecommendations
- RAPPORT_RESOLUTION_TESTS_CYCLE1.md
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 08:43:55 +00:00
|
|
|
exclude: [
|
|
|
|
|
...configDefaults.exclude,
|
|
|
|
|
'**/e2e/**', // Playwright E2E tests (run via playwright test)
|
|
|
|
|
],
|
Phase 2 stabilisation: code mort, Modal→Dialog, feature flags, tests, router split, Rust legacy
Bloc A - Code mort:
- Suppression Studio (components, views, features)
- Suppression gamification + services mock (projectService, storageService, gamificationService)
- Mise à jour Sidebar, Navbar, locales
Bloc B - Frontend:
- Suppression modal.tsx deprecated, Modal.stories (doublon Dialog)
- Feature flags: PLAYLIST_SEARCH, PLAYLIST_RECOMMENDATIONS, ROLE_MANAGEMENT = true
- Suppression 19 tests orphelins, retrait exclusions vitest.config
Bloc C - Backend:
- Extraction routes_auth.go depuis router.go
Bloc D - Rust:
- Suppression security_legacy.rs (code mort, patterns déjà dans security/)
2026-02-14 16:23:32 +00:00
|
|
|
pool: 'threads',
|
|
|
|
|
poolOptions: {
|
|
|
|
|
threads: {
|
|
|
|
|
maxThreads: 2,
|
|
|
|
|
minThreads: 1,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
fileParallelism: false,
|
2025-12-03 21:56:50 +00:00
|
|
|
coverage: {
|
|
|
|
|
provider: 'v8',
|
|
|
|
|
reporter: ['text', 'json', 'html'],
|
|
|
|
|
exclude: [
|
|
|
|
|
'node_modules/',
|
|
|
|
|
'src/test/',
|
|
|
|
|
'**/*.d.ts',
|
|
|
|
|
'**/*.config.*',
|
|
|
|
|
'**/coverage/**',
|
|
|
|
|
'**/dist/**',
|
|
|
|
|
'**/.{idea,git,cache,output,temp}/**',
|
|
|
|
|
'**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
|
|
|
|
|
],
|
|
|
|
|
thresholds: {
|
2026-03-03 20:18:53 +00:00
|
|
|
// v1.0.2: ROADMAP critère 5 > 50% global
|
2025-12-03 21:56:50 +00:00
|
|
|
global: {
|
2026-03-03 20:18:53 +00:00
|
|
|
branches: 50,
|
|
|
|
|
functions: 50,
|
|
|
|
|
lines: 50,
|
|
|
|
|
statements: 50,
|
2025-12-03 21:56:50 +00:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-02-03 08:37:16 +00:00
|
|
|
// projects: [
|
|
|
|
|
// {
|
|
|
|
|
// extends: true,
|
|
|
|
|
// plugins: [
|
|
|
|
|
// // The plugin will run tests for the stories defined in your Storybook config
|
|
|
|
|
// // See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
|
|
|
|
|
// // storybookTest({
|
|
|
|
|
// // configDir: path.join(dirname, '.storybook'),
|
|
|
|
|
// // }),
|
|
|
|
|
// ],
|
|
|
|
|
// test: {
|
|
|
|
|
// name: 'storybook',
|
|
|
|
|
// browser: {
|
|
|
|
|
// enabled: true,
|
|
|
|
|
// headless: true,
|
|
|
|
|
// provider: 'playwright',
|
|
|
|
|
// instances: [
|
|
|
|
|
// {
|
|
|
|
|
// browser: 'chromium',
|
|
|
|
|
// },
|
|
|
|
|
// ],
|
|
|
|
|
// },
|
|
|
|
|
// setupFiles: ['.storybook/vitest.setup.ts'],
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// extends: true,
|
|
|
|
|
// plugins: [
|
|
|
|
|
// // The plugin will run tests for the stories defined in your Storybook config
|
|
|
|
|
// // See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
|
|
|
|
|
// // storybookTest({
|
|
|
|
|
// // configDir: path.join(dirname, '.storybook'),
|
|
|
|
|
// // }),
|
|
|
|
|
// ],
|
|
|
|
|
// test: {
|
|
|
|
|
// name: 'storybook',
|
|
|
|
|
// browser: {
|
|
|
|
|
// enabled: true,
|
|
|
|
|
// headless: true,
|
|
|
|
|
// provider: 'playwright',
|
|
|
|
|
// instances: [
|
|
|
|
|
// {
|
|
|
|
|
// browser: 'chromium',
|
|
|
|
|
// },
|
|
|
|
|
// ],
|
|
|
|
|
// },
|
|
|
|
|
// setupFiles: ['.storybook/vitest.setup.ts'],
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// extends: true,
|
|
|
|
|
// plugins: [
|
|
|
|
|
// // The plugin will run tests for the stories defined in your Storybook config
|
|
|
|
|
// // See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
|
|
|
|
|
// // storybookTest({
|
|
|
|
|
// // configDir: path.join(dirname, '.storybook'),
|
|
|
|
|
// // }),
|
|
|
|
|
// ],
|
|
|
|
|
// test: {
|
|
|
|
|
// name: 'storybook',
|
|
|
|
|
// browser: {
|
|
|
|
|
// enabled: true,
|
|
|
|
|
// headless: true,
|
|
|
|
|
// provider: 'playwright',
|
|
|
|
|
// instances: [
|
|
|
|
|
// {
|
|
|
|
|
// browser: 'chromium',
|
|
|
|
|
// },
|
|
|
|
|
// ],
|
|
|
|
|
// },
|
|
|
|
|
// setupFiles: ['.storybook/vitest.setup.ts'],
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// extends: true,
|
|
|
|
|
// plugins: [
|
|
|
|
|
// // The plugin will run tests for the stories defined in your Storybook config
|
|
|
|
|
// // See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
|
|
|
|
|
// // storybookTest({
|
|
|
|
|
// // configDir: path.join(dirname, '.storybook'),
|
|
|
|
|
// // }),
|
|
|
|
|
// ],
|
|
|
|
|
// test: {
|
|
|
|
|
// name: 'storybook',
|
|
|
|
|
// browser: {
|
|
|
|
|
// enabled: true,
|
|
|
|
|
// headless: true,
|
|
|
|
|
// provider: 'playwright',
|
|
|
|
|
// instances: [
|
|
|
|
|
// {
|
|
|
|
|
// browser: 'chromium',
|
|
|
|
|
// },
|
|
|
|
|
// ],
|
|
|
|
|
// },
|
|
|
|
|
// setupFiles: ['.storybook/vitest.setup.ts'],
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// extends: true,
|
|
|
|
|
// plugins: [
|
|
|
|
|
// // The plugin will run tests for the stories defined in your Storybook config
|
|
|
|
|
// // See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
|
|
|
|
|
// // storybookTest({
|
|
|
|
|
// // configDir: path.join(dirname, '.storybook'),
|
|
|
|
|
// // }),
|
|
|
|
|
// ],
|
|
|
|
|
// test: {
|
|
|
|
|
// name: 'storybook',
|
|
|
|
|
// browser: {
|
|
|
|
|
// enabled: true,
|
|
|
|
|
// headless: true,
|
|
|
|
|
// provider: 'playwright',
|
|
|
|
|
// instances: [
|
|
|
|
|
// {
|
|
|
|
|
// browser: 'chromium',
|
|
|
|
|
// },
|
|
|
|
|
// ],
|
|
|
|
|
// },
|
|
|
|
|
// setupFiles: ['.storybook/vitest.setup.ts'],
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
// ],
|
2025-12-03 21:56:50 +00:00
|
|
|
},
|
|
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
|
|
|
|
'@': path.resolve(__dirname, './src'),
|
|
|
|
|
'@components': path.resolve(__dirname, './src/components'),
|
|
|
|
|
'@pages': path.resolve(__dirname, './src/pages'),
|
|
|
|
|
'@hooks': path.resolve(__dirname, './src/hooks'),
|
|
|
|
|
'@services': path.resolve(__dirname, './src/services'),
|
|
|
|
|
'@types': path.resolve(__dirname, './src/types'),
|
|
|
|
|
'@utils': path.resolve(__dirname, './src/utils'),
|
|
|
|
|
'@stores': path.resolve(__dirname, './src/stores'),
|
|
|
|
|
'@locales': path.resolve(__dirname, './src/locales'),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|