Skip to content

Commit

Permalink
rebase-cleanup: restore logout AND ITS TESTS (#1479)
Browse files Browse the repository at this point in the history
The previous commit re-enabled logout by correctly passing the
`x-okapi-tenant` header in the `/authn/logout` request. It turns out
that if you want read the tenant from the store in a test, you have to
mock the store in your test. WHO KNEW???
  • Loading branch information
zburke committed May 23, 2024
1 parent bc57819 commit bc04288
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/loginServices.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ describe('logout', () => {
global.fetch = jest.fn().mockImplementation(() => Promise.resolve());
const store = {
dispatch: jest.fn(),
getState: jest.fn(),
};
window.sessionStorage.clear();

Expand All @@ -496,6 +497,7 @@ describe('logout', () => {
localStorage.setItem(SESSION_NAME, 'true');
const store = {
dispatch: jest.fn(),
getState: jest.fn(),
};
window.sessionStorage.clear();

Expand Down

0 comments on commit bc04288

Please sign in to comment.