dd-timer/tests/e2e/navigation.spec.ts
POL Mickaël 203c423f19 test: 302 tests unitaires + 20 E2E Playwright (couverture 94%)
- Unit : domain (GaugeCalculator, Enclos, Dragodinde, XpTable, Race, Tier...)
- Unit : application (commands, queries, CommandBus)
- Fonctionnel : breeding-workflow, enclos-management, timer-workflow
- Régression : gauge-tier, gauge-recharge, xp-timer, level-target, breeding
- E2E Playwright + Electron : navigation, timer, recharge jauge,
  accouplement, persistance des données

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 05:43:29 +02:00

55 lines
2.2 KiB
TypeScript

/**
* Tests E2E — Navigation dans la sidebar
*
* Verifie que chaque element de la sidebar affiche la bonne vue.
*/
import { test, expect } from './electron-app';
test.describe('Navigation sidebar', () => {
test('Cliquer sur "Tableau de bord" affiche le dashboard', async ({ page }) => {
await page.click('.sb-item[data-view="dashboard"]');
// Le dashboard est la vue par defaut, verifions que le contenu est affiche
await expect(page.locator('#enclos-content')).not.toBeEmpty();
});
test('Cliquer sur "Statistiques" affiche la vue statistiques', async ({ page }) => {
await page.click('.sb-item[data-view="statistiques"]');
await expect(page.locator('#enclos-content')).not.toBeEmpty();
});
test('Cliquer sur un enclos affiche la vue enclos', async ({ page }) => {
// Le premier enclos a un data-view numerique (son id)
const firstEnclos = page.locator('.sb-item[data-view]').filter({
has: page.locator('.sb-dot'),
}).first();
await firstEnclos.click();
// La vue enclos contient le conteneur .enclos-view
await expect(page.locator('.enclos-view')).toBeVisible({ timeout: 5000 });
});
test('Cliquer sur "Accouplement" affiche la vue accouplement', async ({ page }) => {
await page.click('.sb-item[data-view="accouplement"]');
await expect(page.locator('.accoup-view')).toBeVisible({ timeout: 5000 });
});
test('Cliquer sur "Reappro" affiche la vue reappro', async ({ page }) => {
await page.click('.sb-item[data-view="appro"]');
await expect(page.locator('#enclos-content')).not.toBeEmpty();
});
test('Cliquer sur "Inventaire" affiche la vue inventaire', async ({ page }) => {
await page.click('.sb-item[data-view="inventaire"]');
await expect(page.locator('#enclos-content')).not.toBeEmpty();
});
test('Cliquer sur "Workflows" affiche la vue workflows', async ({ page }) => {
await page.click('.sb-item[data-view="workflows"]');
await expect(page.locator('#enclos-content')).not.toBeEmpty();
});
test('Cliquer sur "Parametres" affiche la vue parametres', async ({ page }) => {
await page.click('.sb-item[data-view="parametres"]');
await expect(page.locator('#enclos-content')).not.toBeEmpty();
});
});