From c9bc957d2aafbeefeb885608ab27bec2532f4a9a Mon Sep 17 00:00:00 2001 From: Sylvain Duchesne Date: Mon, 26 Jan 2026 18:32:16 +0100 Subject: [PATCH] Suggest on creation + distance in kms --- features/event/us-13-creer-evenement.feature | 12 + features/step_definitions/form.steps.ts | 26 + features/step_definitions/screen.steps.ts | 11 + .../user/us-10-profil-participant.feature | 4 + reports/cucumber-report.html | 2 +- reports/cucumber-report.json | 1520 ++++++++++------- src/data/features.ts | 60 +- src/data/stepDefinitions.ts | 30 +- src/data/testResults.ts | 76 +- src/screens/CreateEventScreen.tsx | 112 +- src/screens/EventDetailScreen.tsx | 1 + src/screens/EventsScreen.tsx | 9 +- src/screens/HomeScreen.tsx | 10 +- src/screens/UserProfileScreen.tsx | 20 +- 14 files changed, 1236 insertions(+), 657 deletions(-) diff --git a/features/event/us-13-creer-evenement.feature b/features/event/us-13-creer-evenement.feature index e5c7841..abf793b 100644 --- a/features/event/us-13-creer-evenement.feature +++ b/features/event/us-13-creer-evenement.feature @@ -31,6 +31,18 @@ Fonctionnalité: US-13 Relayer/Modifier/Supprimer un événement Étant donné que je suis sur la page "relayer un événement" Alors je peux annuler et revenir à l'écran précédent + Scénario: Détecter un événement similaire déjà relayé + Étant donné que l'écran "create-event" est affiché + Alors le formulaire permet de détecter les doublons + + Scénario: Importer un événement depuis une source externe + Étant donné que l'écran "create-event" est affiché + Alors le formulaire permet d'importer depuis Mobilizon ou Transiscope + + Scénario: Pas d'alerte doublon lors d'un import externe + Étant donné que l'écran "create-event" est affiché + Alors l'import externe ne déclenche pas d'alerte doublon + Scénario: Modifier un événement * Scénario non implémenté diff --git a/features/step_definitions/form.steps.ts b/features/step_definitions/form.steps.ts index b046193..615ae0e 100644 --- a/features/step_definitions/form.steps.ts +++ b/features/step_definitions/form.steps.ts @@ -60,3 +60,29 @@ Then('le champ {string} est présent', async function (this: FestipodWorld, fiel // Steps removed: Form display/validation steps (le champ affiche, erreur de validation, formulaire affiche N champs) // require browser automation. Scenarios needing these use "* Scénario non implémenté" placeholder. + +Then('le formulaire permet de détecter les doublons', async function (this: FestipodWorld) { + expect(this.currentScreenId).to.equal('create-event'); + const source = this.getRenderedText(); + // CreateEventScreen.tsx has: showDuplicateWarning logic and "Événement similaire détecté" warning + expect(/showDuplicateWarning/.test(source), 'Form should have duplicate detection logic').to.be.true; + expect(/Événement similaire détecté/.test(source), 'Form should have duplicate warning message').to.be.true; +}); + +Then('le formulaire permet d\'importer depuis Mobilizon ou Transiscope', async function (this: FestipodWorld) { + expect(this.currentScreenId).to.equal('create-event'); + const source = this.getRenderedText(); + // CreateEventScreen.tsx has: importableEvents with Mobilizon and Transiscope sources + expect(/importableEvents/.test(source), 'Form should have importable events data').to.be.true; + expect(/Mobilizon/.test(source), 'Form should support Mobilizon import').to.be.true; + expect(/Transiscope/.test(source), 'Form should support Transiscope import').to.be.true; + expect(/Importer depuis une source externe/.test(source), 'Form should have import section').to.be.true; +}); + +Then('l\'import externe ne déclenche pas d\'alerte doublon', async function (this: FestipodWorld) { + expect(this.currentScreenId).to.equal('create-event'); + const source = this.getRenderedText(); + // CreateEventScreen.tsx has: importedFrom state and !importedFrom in showDuplicateWarning condition + expect(/importedFrom/.test(source), 'Form should track import source').to.be.true; + expect(/&& !importedFrom/.test(source), 'Duplicate warning should be disabled for imports').to.be.true; +}); diff --git a/features/step_definitions/screen.steps.ts b/features/step_definitions/screen.steps.ts index da3c206..800dcbc 100644 --- a/features/step_definitions/screen.steps.ts +++ b/features/step_definitions/screen.steps.ts @@ -180,6 +180,17 @@ Then('je peux voir les événements auxquels l\'utilisateur a participé', async expect(/Événements passés/.test(source), 'User profile should have "Événements passés" section').to.be.true; }); +Then('les événements affichent leur localisation et distance', async function (this: FestipodWorld) { + expect(this.currentScreenId).to.equal('user-profile'); + const source = this.getRenderedText(); + // UserProfileScreen.tsx: events have location and distance in data + expect(/location: '[^']+'/.test(source), 'Events should have location data').to.be.true; + expect(/distance: \d+/.test(source), 'Events should have distance data').to.be.true; + // Verify location is rendered in template + expect(/\{event\.location\}/.test(source), 'Events should render location').to.be.true; + expect(/\{event\.distance\}/.test(source), 'Events should render distance').to.be.true; +}); + Then('je peux configurer mes notifications', async function (this: FestipodWorld) { expect(this.currentScreenId).to.equal('settings'); const source = this.getRenderedText(); diff --git a/features/user/us-10-profil-participant.feature b/features/user/us-10-profil-participant.feature index 49ca14b..2b68d02 100644 --- a/features/user/us-10-profil-participant.feature +++ b/features/user/us-10-profil-participant.feature @@ -17,6 +17,10 @@ Fonctionnalité: US-10 Visualiser la fiche/le profil d'un participant Étant donné que je suis sur la page "profil utilisateur" Alors je peux voir les événements auxquels l'utilisateur a participé + Scénario: Voir la localisation des événements + Étant donné que je suis sur la page "profil utilisateur" + Alors les événements affichent leur localisation et distance + Scénario: Voir le formulaire de contact Étant donné que je suis sur la page "profil utilisateur" Alors je peux contacter l'utilisateur diff --git a/reports/cucumber-report.html b/reports/cucumber-report.html index c8edd4c..46ac736 100644 --- a/reports/cucumber-report.html +++ b/reports/cucumber-report.html @@ -46,7 +46,7 @@