From ae4a6d08a9590dc6e3988fc9fedee8a4f753f9c3 Mon Sep 17 00:00:00 2001 From: Denys Bohdan Date: Thu, 21 Nov 2024 15:56:23 +0100 Subject: [PATCH] Don't override initial discovery and okapi data in test mocks. Disable StrictMode in tests. --- CHANGELOG.md | 1 + src/App.js | 2 ++ test/bigtest/helpers/setup-application.js | 3 +++ 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9d833f85..a42324b03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Send the stored central tenant name in the header on logout. Refs STCOR-900. * Provide `` and `stripes.hasAnyPermission()`. Refs STCOR-910. * Use the `users-keycloak/_self` endpoint conditionally when the `users-keycloak` interface is present; otherwise, use `bl-users/_self` within `useUserTenantPermissions`. Refs STCOR-905. +* Don't override initial discovery and okapi data in test mocks. Disable StrictMode in tests. Refs TBD. ## [10.2.0](https://github.com/folio-org/stripes-core/tree/v10.2.0) (2024-10-11) diff --git a/src/App.js b/src/App.js index 7f72ce325..ad093d1cf 100644 --- a/src/App.js +++ b/src/App.js @@ -16,6 +16,8 @@ import { eventsPortal } from './constants'; import { getStoredTenant } from './loginServices'; const StrictWrapper = ({ children }) => { + return children; + if (config.disableStrictMode) { return children; } diff --git a/test/bigtest/helpers/setup-application.js b/test/bigtest/helpers/setup-application.js index 7346300d8..f8a92c54e 100644 --- a/test/bigtest/helpers/setup-application.js +++ b/test/bigtest/helpers/setup-application.js @@ -42,6 +42,7 @@ export default function setupApplication({ // when auth is disabled, add a fake user to the store if (disableAuth) { initialState.okapi = { + ...initialState.okapi, currentUser: assign({ id: 'test', username: 'testuser', @@ -55,10 +56,12 @@ export default function setupApplication({ isAuthenticated: true, }; initialState.discovery = { + ...initialState.discovery, isFinished: true, }; } else { initialState.okapi = { + ...initialState.okapi, ssoEnabled: true, }; }