From ff6095d53bc2373856979a4d9ccf65a508c185c4 Mon Sep 17 00:00:00 2001 From: Victor Zeinstra Date: Wed, 18 Dec 2024 12:12:37 +0100 Subject: [PATCH] fix: search cc tracking (#6373) * fix: tracking manquant recherche cc * chore: clean * fix: test e2e ajout useeffect * fix: ajout tracking particulier employeur --------- Co-authored-by: victor --- .../AgreementSearch/AgreementSearch.tsx | 7 +- .../AgreementSearch/AgreementSearchInput.tsx | 8 +- .../AgreementSearch/AgreementSearchIntro.tsx | 13 +++ .../__tests__/AgreementSearchByName.test.tsx | 25 ++++-- .../__tests__/AgreementSearchIntro.test.tsx | 51 +++++++++++ .../convention-collective/__tests__/ui.ts | 11 +++ .../modules/convention-collective/tracking.ts | 71 ++++++++++++++- .../EnterpriseAgreementSearch.tsx | 7 +- .../EnterpriseAgreementSearchInput.tsx | 13 ++- .../EnterpriseAgreementSelection.tsx | 6 ++ .../__tests__/AgreementSelection.test.tsx | 28 +++++- .../EnterpriseAgreementSearch.test.tsx | 90 ++++++++++++------- .../EnterpriseAgreementSearch/__tests__/ui.ts | 1 + .../EnterpriseAgreementSearch/tracking.ts | 50 ++++++++++- 14 files changed, 329 insertions(+), 52 deletions(-) create mode 100644 packages/code-du-travail-frontend/src/modules/convention-collective/__tests__/AgreementSearchIntro.test.tsx diff --git a/packages/code-du-travail-frontend/src/modules/convention-collective/AgreementSearch/AgreementSearch.tsx b/packages/code-du-travail-frontend/src/modules/convention-collective/AgreementSearch/AgreementSearch.tsx index b5269baa29..b7beb41a01 100644 --- a/packages/code-du-travail-frontend/src/modules/convention-collective/AgreementSearch/AgreementSearch.tsx +++ b/packages/code-du-travail-frontend/src/modules/convention-collective/AgreementSearch/AgreementSearch.tsx @@ -5,9 +5,11 @@ import { useState } from "react"; import Button from "@codegouvfr/react-dsfr/Button"; import { ButtonStyle } from "../style"; import { AgreementSearchInput } from "./AgreementSearchInput"; +import { useAgreementSearchTracking } from "../tracking"; export const AgreementSearch = () => { const [noResult, setNoResult] = useState(false); + const { emitPreviousEvent } = useAgreementSearchTracking(); return ( <> { />