summaryrefslogtreecommitdiffstats
path: root/src/app/analytics/AnalyticsActions.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/analytics/AnalyticsActions.js')
-rw-r--r--src/app/analytics/AnalyticsActions.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/app/analytics/AnalyticsActions.js b/src/app/analytics/AnalyticsActions.js
index fea01f0..6053fb5 100644
--- a/src/app/analytics/AnalyticsActions.js
+++ b/src/app/analytics/AnalyticsActions.js
@@ -28,7 +28,8 @@ let fetch = require('node-fetch');
export function getStoreAnalyticsPayload() {
var documentBody = document.body.getElementsByTagName('*');
- return documentBody[0].innerHTML.replace('\s+', '');
+ // document.body is not available while running jest tests
+ return documentBody[0] ? documentBody[0].innerHTML.replace('\s+', '') : '';
}
function getAnalyticsPostBody(payload){