Skip to content

Commit

Permalink
Don't override initial discovery and okapi data in test mocks. Disabl…
Browse files Browse the repository at this point in the history
…e StrictMode in tests.
  • Loading branch information
BogdanDenis committed Nov 21, 2024
1 parent 943d67a commit ae4a6d0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Send the stored central tenant name in the header on logout. Refs STCOR-900.
* Provide `<IfAnyPermission>` 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)
Expand Down
2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { eventsPortal } from './constants';
import { getStoredTenant } from './loginServices';

const StrictWrapper = ({ children }) => {
return children;

if (config.disableStrictMode) {

Check failure on line 21 in src/App.js

View workflow job for this annotation

GitHub Actions / ui / Install and lint / Install and lint

Unreachable code
return children;
}
Expand Down
3 changes: 3 additions & 0 deletions test/bigtest/helpers/setup-application.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -55,10 +56,12 @@ export default function setupApplication({
isAuthenticated: true,
};
initialState.discovery = {
...initialState.discovery,
isFinished: true,
};
} else {
initialState.okapi = {
...initialState.okapi,
ssoEnabled: true,
};
}
Expand Down

0 comments on commit ae4a6d0

Please sign in to comment.