Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
havenbarnes committed Nov 28, 2024
1 parent 89e8dea commit 70425b8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions cypress/e2e/capture.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,31 @@ describe('Event capture', () => {
cy.phCaptures().should('include', '$feature_flag_called')
})

it('captures $feature_flag_called with bootstrapped value properties', () => {
start({
options: {
bootstrap: {
featureFlags: {
'some-feature': 'some-value',
},
featureFlagPayloads: {
'some-feature': 'some-payload',
},
},
},
})

cy.get('[data-cy-feature-flag-button]').click()

cy.phCaptures({ full: true }).then((captures) => {
const flagCallEvents = captures.filter((capture) => capture.event === '$feature_flag_called')
expect(flagCallEvents.length).to.eq(1)
const flagCallEvent = flagCallEvents[0]
expect(flagCallEvent.properties.$feature_flag_bootstrapped_response).to.equal('some-value')
expect(flagCallEvent.properties.$feature_flag_bootstrapped_payload).to.equal('some-payload')
})
})

it('captures rage clicks', () => {
start({ options: { rageclick: true } })

Expand Down

0 comments on commit 70425b8

Please sign in to comment.