From 5e0b042c5f6515838818707a33026ea7932c7554 Mon Sep 17 00:00:00 2001
From: pkupczyk <piotr.kupczyk@id.ethz.ch>
Date: Mon, 2 Jan 2023 11:31:01 +0100
Subject: [PATCH] SSDM-13270 : Admin UI - update libraries - fix tests

---
 openbis_ng_ui/babel.config.js | 2 +-
 openbis_ng_ui/jest.config.js  | 4 +++-
 openbis_ng_ui/package.json    | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/openbis_ng_ui/babel.config.js b/openbis_ng_ui/babel.config.js
index 7db4fe80035..be74a9441f6 100644
--- a/openbis_ng_ui/babel.config.js
+++ b/openbis_ng_ui/babel.config.js
@@ -1,5 +1,5 @@
 /* eslint-disable-next-line no-undef */
-module.exports = function(api) {
+module.exports = function (api) {
   api.cache(true)
 
   const presets = ['@babel/preset-env', '@babel/preset-react']
diff --git a/openbis_ng_ui/jest.config.js b/openbis_ng_ui/jest.config.js
index f493ac2b3bb..1129d569d57 100644
--- a/openbis_ng_ui/jest.config.js
+++ b/openbis_ng_ui/jest.config.js
@@ -1,6 +1,7 @@
 /* eslint-disable-next-line no-undef */
 module.exports = {
-  testURL: 'http://localhost/#/',
+  testEnvironment: 'jsdom',
+  testEnvironmentOptions: { url: 'http://localhost/#/' },
   reporters: [
     'default',
     [
@@ -34,5 +35,6 @@ module.exports = {
     '^@srcTest/(.*)$': '<rootDir>/srcTest/$1',
     '^@srcV3/(.*)$': '<rootDir>/srcV3/$1'
   },
+  transformIgnorePatterns: ['<rootDir>/node_modules/(?!auto-bind)'],
   slowTestThreshold: 30
 }
diff --git a/openbis_ng_ui/package.json b/openbis_ng_ui/package.json
index cafee64291b..a9caea6ac82 100644
--- a/openbis_ng_ui/package.json
+++ b/openbis_ng_ui/package.json
@@ -56,6 +56,7 @@
     "file-loader": "^6.2.0",
     "html-webpack-plugin": "^5.5.0",
     "jest": "^29.3.1",
+    "jest-environment-jsdom": "^29.3.1",
     "jest-junit": "^15.0.0",
     "prettier": "^2.8.1",
     "raw-loader": "^4.0.2",
-- 
GitLab