Skip to content

Commit

Permalink
STCOR-913 Don't override initial discovery and okapi data in test moc…
Browse files Browse the repository at this point in the history
…ks (#1564)

Updating `stripes-core` in SSC causes 30+ tests to fail.
folio-org/stripes-smart-components#1538
This PR addresses some issues which cause these failures.

Overwriting of initial okapi and discovery data in `setupApplication`
helper. Some tests require custom okapi data, but `setupApplication` in
some cases can overwrite that data which makes those tests fail.

Still investigating a few failing tests so maybe there's something
else that needs to be fixed.

(cherry picked from commit 1c73afd)
  • Loading branch information
BogdanDenis authored and zburke committed Dec 2, 2024
1 parent 7092de4 commit 4c8d202
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 10.2.4 IN PROGRESS

* 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. Refs STCOR-913.

## [10.2.3](https://github.com/folio-org/stripes-core/tree/v10.2.3) (2024-11-15)
[Full Changelog](https://github.com/folio-org/stripes-core/compare/v10.2.2...v10.2.3)
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 4c8d202

Please sign in to comment.