-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WORLDSERVICE-79: Enable Reverb on LIVE for PIDGIN #12375
base: latest
Are you sure you want to change the base?
Conversation
@@ -80,6 +80,14 @@ describe('sendBeacon', () => { | |||
expect(reverbMock.viewEvent).toHaveBeenCalledTimes(1); | |||
}); | |||
|
|||
it('should not call Reverb viewEvent if Reverb is not enabled for a service', async () => { | |||
const sendBeacon = require('./index').default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to declare the sendBeacon
at a higher level within the describe block so that it can be re-used for each unit test or does it have to be declared each time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated how the test is set up to enable us to mock onClient
in a manner that enables use to import sendBeacon
once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one! looking forward to seeing it on Live
@@ -80,6 +80,14 @@ describe('sendBeacon', () => { | |||
expect(reverbMock.viewEvent).toHaveBeenCalledTimes(1); | |||
}); | |||
|
|||
it('should not call Reverb viewEvent if Reverb is not enabled for a service', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if I understand these "if Reverb is not enabled for a service" tests - I can't see where this is declared in the test file - could we make it a bit more explicit - perhaps by mocking the service context or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As these are unit tests, mocking the ServiceContext may not yield the desired
outcome. I've declared a variable here with an annotation to indicate the scenario
where the argument, reverbBeaconConfig, would be passed as null.
This relates to the conditional check in ATIAnalytics and sendEventBeacon
where reverbBeaconConfig resolves to null
.
Additionally, I've added integration tests here and here to assert Reverb values resolve
to null
when Reverb is disabled for a service.
….com:bbc/simorgh into WORLDSERVICE-79-enable-reverb-on-live-pidgin
Resolves JIRA WORLDSERVICE-79
Overall changes
Enable Reverb tracking for PIDGIN on LIVE.
Code changes
isLive
check to lift the restriction barring Reverb tracking on LIVE.Testing
Network
tab, verify that page view tracking and component event tracking is done via Reverb.Helpful Links
Add Links to useful resources related to this PR if applicable.
Coding Standards
Repository use guidelines