mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-19 20:52:32 -04:00
Revert "Merge pull request #3238 from alphagov/cookies-update"
This reverts commiteec4bec761, reversing changes made to64480e2fff.
This commit is contained in:
@@ -18,23 +18,18 @@ describe('Error tracking', () => {
|
||||
afterEach(() => {
|
||||
|
||||
document.body.innerHTML = '';
|
||||
delete window.GOVUK.analytics;
|
||||
|
||||
});
|
||||
|
||||
test("If there is an analytics tracker set up, it should send details of the error to window.GOVUK.analytic", () => {
|
||||
test("It should send the right data to Google Analytics", () => {
|
||||
|
||||
window.GOVUK.analytics = {
|
||||
'trackEvent': jest.fn()
|
||||
};
|
||||
window.ga = jest.fn(() => {});
|
||||
|
||||
// start the module
|
||||
window.GOVUK.modules.start();
|
||||
|
||||
expect(window.GOVUK.analytics.trackEvent).toHaveBeenCalled();
|
||||
expect(window.GOVUK.analytics.trackEvent.mock.calls[0]).toEqual(['Error', 'validation', {
|
||||
'label': 'missing field'
|
||||
}]);
|
||||
expect(window.ga).toHaveBeenCalled();
|
||||
expect(window.ga.mock.calls[0]).toEqual(['send', 'event', 'Error', 'validation', 'missing field']);
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user