Skip to content

Commit

Permalink
Test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
asanchezr committed Oct 27, 2023
1 parent 9b04fc4 commit 16f98b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions source/frontend/src/AppRouter.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ADD_ACTIVATE_USER, GET_REQUEST_ACCESS } from './constants/actionTypes';
import { AuthStateContext } from './contexts/authStateContext';
import { useApiUsers } from './hooks/pims-api/useApiUsers';
import { mockLookups } from './mocks/lookups.mock';
import { getUserMock } from './mocks/user.mock';
import { getMockPagedUsers, getUserMock } from './mocks/user.mock';
import { lookupCodesSlice } from './store/slices/lookupCodes';
import { networkSlice } from './store/slices/network/networkSlice';
import { tenantsSlice } from './store/slices/tenants';
Expand Down Expand Up @@ -63,7 +63,7 @@ jest.mock('./hooks/pims-api/useApiUsers');
activateUser: jest.fn(),
getUser: jest.fn().mockResolvedValue(getUserMock()),
getUserInfo: jest.fn().mockResolvedValue(getUserMock()),
getUsersPaged: jest.fn(),
getUsersPaged: jest.fn().mockResolvedValue(getMockPagedUsers()),
putUser: jest.fn(),
exportUsers: jest.fn(),
});
Expand Down
4 changes: 3 additions & 1 deletion source/frontend/src/mocks/user.mock.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { IPagedItems } from '@/interfaces';
import { Api_User } from '@/models/api/User';

export const getUserMock = (): Api_User => ({
Expand Down Expand Up @@ -145,7 +146,7 @@ export const getUserMock = (): Api_User => ({
rowVersion: 107,
});

export const getMockPagedUsers = () => ({
export const getMockPagedUsers = (): IPagedItems<Api_User> => ({
items: [
{
id: 30,
Expand Down Expand Up @@ -538,6 +539,7 @@ export const getMockPagedUsers = () => ({
},
],
page: 1,
pageIndex: 0,
quantity: 5,
total: 42,
});

0 comments on commit 16f98b1

Please sign in to comment.