Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aidynoJ committed Feb 5, 2025
1 parent e849fda commit acb53da
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/loginServices.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ describe('createOkapiSession', () => {
getState: () => ({
okapi: {
currentPerms: [],
url:'okapiUrl'
}
}),
};
Expand Down Expand Up @@ -267,6 +268,7 @@ describe('validateUser', () => {
it('handles fetch failure from "_self"', async () => {
const store = {
dispatch: jest.fn(),
getState: () => ({ okapi: { tenant: 'monkeyURL' } }),
};

mockFetchError();
Expand All @@ -279,6 +281,7 @@ describe('validateUser', () => {
it('handles valid user with empty tenant in session', async () => {
const store = {
dispatch: jest.fn(),
getState: () => ({ okapi: { tenant: 'monkeyURL' } }),
};

const tenant = 'tenant';
Expand Down Expand Up @@ -307,6 +310,7 @@ describe('validateUser', () => {
it('handles valid user with tenant in session', async () => {
const store = {
dispatch: jest.fn(),
getState: () => ({ okapi: { tenant: 'monkeyURL' } }),
};

const tenant = 'tenant';
Expand All @@ -332,6 +336,7 @@ describe('validateUser', () => {
it('overwrites session data with new values from _self', async () => {
const store = {
dispatch: jest.fn(),
getState: () => ({ okapi: { tenant: 'monkeyURL' } }),
};

const tenant = 'tenant';
Expand Down

0 comments on commit acb53da

Please sign in to comment.