Skip to content

Commit

Permalink
Fix/Update test
Browse files Browse the repository at this point in the history
Removing the analytics test for now.  This test was mainly used to make
sure the array was properly pushed to, and that it does the right thing
if the global is undefined.  I think this module is simple enough to
leave as a proxy to the GTM call.  We can add more testing for the
logger in the future.
  • Loading branch information
thostetler committed Feb 5, 2024
1 parent f19a00d commit a365155
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 134 deletions.
7 changes: 5 additions & 2 deletions src/js/components/analytics.js
Expand Up @@ -86,8 +86,11 @@ define(['underscore', 'jquery'], function (_, $) {
adsLogger.apply(null, _.rest(arguments, 3));

// if the action is send and the event is event, then we want to send the event to the dataLayer
if (action === 'send' && event === 'event') {

if (
action === 'send' &&
event === 'event' &&
Array.isArray(window.dataLayer)
) {
// some events are 'interaction' or 'error', so add that to the event name
window.dataLayer.push({
event: `${type}_${description}`,
Expand Down
132 changes: 0 additions & 132 deletions test/mocha/js/components/analytics.spec.js

This file was deleted.

0 comments on commit a365155

Please sign in to comment.