Skip to content

Commit

Permalink
mock getUserFromJwt
Browse files Browse the repository at this point in the history
  • Loading branch information
john-tco committed Sep 6, 2023
1 parent b2d4f54 commit a9e4cd8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ jest.mock('next/dist/server/api-utils/node', () => ({

jest.mock('../../../../services/SuperAdminService', () => ({
getUserById: jest.fn(() => Promise.resolve({ statusCode: 200 })),
getUserFromJwt: () =>
Promise.resolve({ ...mockPageData.user, gapUserId: '2' }),
updateUserRoles: jest.fn(),
}));

const mockPageData = {
isViewingOwnAccount: false,
user: {
gapUserId: '1',
created: 'rn',
sub: 'za',
firstName: 'testFirstName',
lastName: 'testLastName',
organisationName: 'tco',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ jest.mock('next/dist/server/api-utils/node', () => ({

jest.mock('../../../../services/SuperAdminService', () => ({
getUserById: jest.fn(() => Promise.resolve({ statusCode: 200 })),
getUserFromJwt: () =>
Promise.resolve({ ...mockPageData.user, gapUserId: '2' }),
deleteUserInformation: jest.fn(),
}));

const mockPageData = {
isViewingOwnAccount: false,
user: {
gapUserId: '1',
created: 'rn',
sub: 'za',
firstName: 'testFirstName',
lastName: 'testLastName',
organisationName: 'tco',
Expand Down

0 comments on commit a9e4cd8

Please sign in to comment.