Skip to content

Commit

Permalink
Merge pull request #128 from SocialGouv/feat/suppr-abtesting-bt-contact
Browse files Browse the repository at this point in the history
feat(abtesting): suppression sur le bt contacter
  • Loading branch information
alebret authored Jan 16, 2023
2 parents bac58d2 + e009165 commit 5e1a5b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
7 changes: 5 additions & 2 deletions __tests__/components/ab-testing/measuring-intentions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
seRapprocheDeLaRealite,
} from "../../../src/utils/ab-testing/measuring-intentions.utils"
import { displayComponentsByTest } from "../../../src/components/ab-testing/intentions/MeasuringIntentions"
import * as ContactMamanBlues from "../../../src/components/results/ContactMamanBlues"

describe("UI de MeasuringIntentions", () => {
const findLabelEstLePlusAdapte = (value) =>
Expand All @@ -32,7 +33,7 @@ describe("UI de MeasuringIntentions", () => {
})
).toBeInTheDocument()
expect(
screen.getByRole("button", { name: "être contacté(e)" })
screen.getByRole("button", { name: ContactMamanBlues.buttonLabel })
).toBeInTheDocument()
}

Expand Down Expand Up @@ -391,7 +392,9 @@ describe("UI de MeasuringIntentions", () => {
expect(yesButton).not.toBeInTheDocument()
expect(await screen.queryByText("Oui")).not.toBeInTheDocument()

expect(await screen.findByText("Prenez une des actions suivantes.")).toBeVisible()
expect(
await screen.findByText("Prenez une des actions suivantes.")
).toBeVisible()

// Nouveaux boutons
expect(
Expand Down
14 changes: 4 additions & 10 deletions src/components/results/ContactMamanBlues.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import React, { useEffect } from "react"
import React from "react"
import { Row } from "react-bootstrap"
import { } from "@dataesr/react-dsfr"
import { useRouter } from "next/router"
import * as TrackerUtils from "../../utils/tracker.utils"
import * as ContactButtonLabelAbTesting from "../../utils/ab-testing/contact-button-label.utils"
import * as AbTestingUtils from "../../utils/ab-testing/ab-testing.utils"

export const buttonLabel = "Je veux être accompagné.e"

export function ContactMamanBlues({ scoreLevel }) {
const router = useRouter()
let colorsByLevel
const buttonLabel = ContactButtonLabelAbTesting.getContactButtonLabelByTest()

switch (scoreLevel) {
case 1:
Expand All @@ -29,19 +28,14 @@ export function ContactMamanBlues({ scoreLevel }) {
TrackerUtils.track(
TrackerUtils.CATEG.contact,
`Macaron d'Elise ${TrackerUtils.EVENT_CLICK}`,
"Être contacté(e)"
{ buttonLabel }
)
AbTestingUtils.trackerForAbTesting(buttonLabel)

router.push({
pathname: "/contact/to-be-contacted",
})
}

useEffect(() => {
AbTestingUtils.trackerForAbTesting(`Macaron Elise - ${colorsByLevel}`)
}, [])

return (
<div className="contact-mamanblues">
<Row className={`contact-content ${colorsByLevel}`}>
Expand Down

0 comments on commit 5e1a5b1

Please sign in to comment.