QA #20 — Section de preuve sociale (Trustpilot) gardée par ENABLE_TRUSTPILOT (runtime)
=======================================================================================
Date        : 2026-06-11
Worktree    : .worktrees/redmine-20-social-proof
Branche     : feat/redmine-20-social-proof
Commit      : 34e3015 (feat(landing): gate social-proof behind ENABLE_TRUSTPILOT)
Port de test: 3010 (npm run dev)
NB: aucun secret (token/clé/.env) reproduit dans ce rapport.

--- 1. Seam serveur (src/app/page.tsx) ---
export const dynamic = 'force-dynamic';                       (rendu par requête)
const socialProofEnabled = process.env.ENABLE_TRUSTPILOT === 'true';   (défaut: false si absent)
=> threadé en prop booléenne: page.tsx -> LandingPageWithBypass -> LandingPage
   -> <LandingSocialProof enabled={socialProofEnabled} />
Placement vérifié dans LandingPage.tsx:
   LandingHowItWorks  ->  LandingSocialProof  ->  LandingCTA   (entre "Comment ça marche" et le CTA)
Composant (LandingSocialProof.tsx) :
   `if (!enabled || count === 0) return null;`  => aucun DOM, aucune donnée factice quand OFF.

--- 2. Tests unitaires (vitest, suite touchée) ---
$ npx vitest run src/components/organisms/landing/__tests__/LandingSocialProof.test.tsx
Test Files  1 passed (1)
     Tests  9 passed (9)
Couvre notamment :
   - returns null when the flag is off (enabled defaults to false)        OK
   - returns null when enabled is explicitly false, even with testimonials OK
   - returns null when enabled but there are no testimonials              OK
   - renders heading, average rating and verified review count           OK
   - links "see all reviews" to Trustpilot url, target=_blank, rel=noopener noreferrer  OK
   - hides controls with single testimonial / next arrow / auto-advance 5s / pause on hover OK

--- 3. Smoke UI — état OFF (ENABLE_TRUSTPILOT NON défini, défaut) ---
$ env -u ENABLE_TRUSTPILOT npm run dev -- -p 3010    (ENABLE_TRUSTPILOT absent du .env)
$ curl -s "http://localhost:3010/?landing=1"
Scan du HTML rendu :
   '4,9'                  : 0
   'avis vérifiés'        : 0
   'Trustpilot/trustpilot': 0
   'Voir tous les avis'   : 0
   'data-social-proof-carousel' : 0
   '★'                    : 0
   socialProofEnabled     : "socialProofEnabled":false   (payload RSC = flag OFF correct)
   (les 44 occurrences de "4.9" = coordonnées de <path> SVG d'icônes, pas une note)
HowItWorks ("Comment ça marche") présent ; reste de la landing intact et contigu.
=> AUCUN contenu factice (étoiles / 4,9/5 / 120 avis / témoignages) rendu. Conforme à l'exigence produit.
Capture : off-state.png (section absente).

--- 4. Smoke UI — état ON (ENABLE_TRUSTPILOT=true) ---
$ env ENABLE_TRUSTPILOT=true npm run dev -- -p 3010
Payload RSC : "socialProofEnabled":true
Rendu client (carrousel via next/dynamic) — snapshot navigateur :
   [img] "4.9 / 5"
   [text] "4,9/5 · 120 avis vérifiés"
   [figure] Marie D. — Développeuse Fullstack — "J'ai trouvé une mission en 2 semaines..."
   [figure] Karim B. — Lead Backend
   [figure] Sofia L. — Ingénieure DevOps
   [button] "Témoignage précédent" / "suivant" + 3 puces "Aller au témoignage N"
   [link]   "Voir tous les avis"  (href=https://www.trustpilot.com/review/getyourjob.pro,
                                    target=_blank, rel=noopener noreferrer — cf. source + test)
Position : entre la section offres/Comment ça marche et le CTA "Créer mon profil".
Style : fond gris très clair (#F9F9F9), étoiles vertes Trustpilot (#00B67A), bordures #E5E5E5.
Capture : on-state-carousel.png (section rendue).

--- 5. Note tsc ---
`npx tsc --noEmit` global : ~2248 erreurs PRÉEXISTANTES dans tout le repo (le build s'appuie sur
ignoreBuildErrors). La seule erreur dans un fichier touché — page.tsx:69 `session?.user` — provient
du refactor SSR antérieur (commit c8f1e61), PAS de ce ticket (34e3015 n'ajoute que les lignes
socialProofEnabled). Aucun fichier de la feature social-proof (LandingSocialProof, config,
RatingStars, TestimonialCard) n'a d'erreur tsc.

VERDICT : PASS
- OFF (défaut) : aucun contenu factice rendu (DOM social-proof totalement absent).
- ON  : carrousel complet rendu (note, nb d'avis, 3 témoignages, flèches, lien Trustpilot).
