diff options
author | Matus Szabo <matus.szabo@orange.com> | 2020-08-19 15:18:50 +0200 |
---|---|---|
committer | Matus Szabo <matus.szabo@orange.com> | 2020-08-19 15:18:50 +0200 |
commit | 371c0e2a5b8ddca26453e269a9170570832d6cc9 (patch) | |
tree | b387eb1a1cc70ac5d507059488264d5a2e7da0d0 /src/app/analytics/AnalyticsActions.js | |
parent | d07851ce63f310aca9bb7b2c79943f9fe1928dcb (diff) |
Added front-end tests
Increased front-end tests coverage to 60.95%
Issue-ID: AAI-3094
Signed-off-by: Matus Szabo <matus.szabo@orange.com>
Change-Id: I3a73737175dbbbd90e21eb3030b2f4b58250ccd5
Diffstat (limited to 'src/app/analytics/AnalyticsActions.js')
-rw-r--r-- | src/app/analytics/AnalyticsActions.js | 3 |
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){ |