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???

(cherry picked from commit 5bc64ce)
  • Loading branch information
zburke committed Jul 25, 2024
1 parent adcf437 commit 17d3f7f
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 @@ -458,6 +458,7 @@ describe('logout', () => {
global.fetch = jest.fn().mockImplementation(() => Promise.resolve());
const store = {
dispatch: jest.fn(),
getState: jest.fn(),
};
window.sessionStorage.clear();

Expand All @@ -479,6 +480,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 17d3f7f

Please sign in to comment.