From 371c0e2a5b8ddca26453e269a9170570832d6cc9 Mon Sep 17 00:00:00 2001 From: Matus Szabo Date: Wed, 19 Aug 2020 15:18:50 +0200 Subject: Added front-end tests Increased front-end tests coverage to 60.95% Issue-ID: AAI-3094 Signed-off-by: Matus Szabo Change-Id: I3a73737175dbbbd90e21eb3030b2f4b58250ccd5 --- src/app/analytics/AnalyticsActions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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){ -- cgit 1.2.3-korg