mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-30 18:53:10 +00:00
fix: prettier format
This commit is contained in:
parent
19683a0efb
commit
9e1e6e552c
1 changed files with 25 additions and 8 deletions
|
|
@ -87,25 +87,35 @@ describe('Petition form Lead wiring', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('fires exactly one Lead on a successful signature with a configured pixel', async () => {
|
it('fires exactly one Lead on a successful signature with a configured pixel', async () => {
|
||||||
render(<PetitionForm id="formulario" petition={petition} consentHTML="" facebookPixelId={PIXEL_ID} />)
|
render(
|
||||||
|
<PetitionForm
|
||||||
|
id="formulario"
|
||||||
|
petition={petition}
|
||||||
|
consentHTML=""
|
||||||
|
facebookPixelId={PIXEL_ID}
|
||||||
|
/>,
|
||||||
|
)
|
||||||
await fillAndSubmit()
|
await fillAndSubmit()
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(screen.getByRole('heading', { name: 'Obrigado por assinar!' })).toBeTruthy()
|
expect(screen.getByRole('heading', { name: 'Obrigado por assinar!' })).toBeTruthy()
|
||||||
})
|
})
|
||||||
expect(trackMetaLeadMock).toHaveBeenCalledTimes(1)
|
expect(trackMetaLeadMock).toHaveBeenCalledTimes(1)
|
||||||
expect(trackMetaLeadMock).toHaveBeenCalledWith(
|
expect(trackMetaLeadMock).toHaveBeenCalledWith(PIXEL_ID, petition.title, expect.any(String))
|
||||||
PIXEL_ID,
|
|
||||||
petition.title,
|
|
||||||
expect.any(String),
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('keeps the committed signature a success when tracking throws', async () => {
|
it('keeps the committed signature a success when tracking throws', async () => {
|
||||||
trackMetaLeadMock.mockImplementation(() => {
|
trackMetaLeadMock.mockImplementation(() => {
|
||||||
throw new Error('crypto.randomUUID is not available')
|
throw new Error('crypto.randomUUID is not available')
|
||||||
})
|
})
|
||||||
render(<PetitionForm id="formulario" petition={petition} consentHTML="" facebookPixelId={PIXEL_ID} />)
|
render(
|
||||||
|
<PetitionForm
|
||||||
|
id="formulario"
|
||||||
|
petition={petition}
|
||||||
|
consentHTML=""
|
||||||
|
facebookPixelId={PIXEL_ID}
|
||||||
|
/>,
|
||||||
|
)
|
||||||
await fillAndSubmit()
|
await fillAndSubmit()
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
|
|
@ -127,7 +137,14 @@ describe('Petition form Lead wiring', () => {
|
||||||
|
|
||||||
it('never fires a Lead when the submission fails', async () => {
|
it('never fires a Lead when the submission fails', async () => {
|
||||||
submitPetitionSignatureMock.mockRejectedValue(new Error('boom'))
|
submitPetitionSignatureMock.mockRejectedValue(new Error('boom'))
|
||||||
render(<PetitionForm id="formulario" petition={petition} consentHTML="" facebookPixelId={PIXEL_ID} />)
|
render(
|
||||||
|
<PetitionForm
|
||||||
|
id="formulario"
|
||||||
|
petition={petition}
|
||||||
|
consentHTML=""
|
||||||
|
facebookPixelId={PIXEL_ID}
|
||||||
|
/>,
|
||||||
|
)
|
||||||
await fillAndSubmit()
|
await fillAndSubmit()
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue