From ec5a4d09b81c1f8b0c790a607bb1e94681038fa1 Mon Sep 17 00:00:00 2001
From: Andrey Antukh <niwi@niwi.nz>
Date: Wed, 23 Mar 2022 23:05:04 +0100
Subject: [PATCH] :bug: Fix possible issue that causes exception on node tests

---
 frontend/src/app/main/errors.cljs | 5 +++--
 frontend/src/app/util/globals.js  | 4 ++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/frontend/src/app/main/errors.cljs b/frontend/src/app/main/errors.cljs
index 12daf2712..9e8ad584b 100644
--- a/frontend/src/app/main/errors.cljs
+++ b/frontend/src/app/main/errors.cljs
@@ -13,6 +13,7 @@
    [app.main.data.messages :as msg]
    [app.main.data.users :as du]
    [app.main.store :as st]
+   [app.util.globals :as glob]
    [app.util.i18n :refer [tr]]
    [app.util.router :as rt]
    [app.util.timers :as ts]
@@ -174,6 +175,6 @@
             (.preventDefault ^js event)
             (some-> (unchecked-get event "error")
                     (on-unhandled-error)))]
-    (.addEventListener js/window "error" on-error)
+    (.addEventListener glob/window "error" on-error)
     (fn []
-      (.removeEventListener js/window "error" on-error))))
+      (.removeEventListener glob/window "error" on-error))))
diff --git a/frontend/src/app/util/globals.js b/frontend/src/app/util/globals.js
index 502f70ddf..12841bec7 100644
--- a/frontend/src/app/util/globals.js
+++ b/frontend/src/app/util/globals.js
@@ -28,6 +28,10 @@ goog.scope(function() {
       addListener(...args) {
       },
       removeListener(...args) {
+      },
+      addEventListener(...args) {
+      },
+      removeEventListener(...args) {
       }
     }
   }