Skip to content

Commit

Permalink
Merge pull request #31 from meriamBenSassi/fix/get-user
Browse files Browse the repository at this point in the history
[FIX] Remove wrong get User
  • Loading branch information
meriamBenSassi authored Dec 6, 2023
2 parents 2e4e087 + 28df50d commit 15ba13d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
8 changes: 0 additions & 8 deletions src/hooks/services/hooks.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ describe('HookService', () => {
let updateCustomerSpy: jest.SpyInstance;
let getIframeUrlSpy: jest.SpyInstance;
let getCustomerByIdSpy: jest.SpyInstance;
let getUserSpy: jest.SpyInstance;
let createNewUserSpy: jest.SpyInstance;

const expectedWidgetConfig = {
Expand All @@ -153,7 +152,6 @@ describe('HookService', () => {
getUserTokenSpy = jest
.spyOn(linxoConnectAuthService, 'getUserToken')
.mockResolvedValue(`user-token-${process.pid}`);
getUserSpy = jest.spyOn(linxoConnectUserService, 'getUser').mockResolvedValue(linxoConnectUserMock);
createNewUserSpy = jest.spyOn(linxoConnectUserService, 'createNewUser').mockResolvedValue(`id-${process.pid}`);
getIframeUrlSpy = jest.spyOn(linxoConnectLinkService, 'getIframeUrl').mockResolvedValue('MY_LINK_URL');
});
Expand Down Expand Up @@ -187,9 +185,6 @@ describe('HookService', () => {
expect(algoanAuthenticateSpy).toHaveBeenCalled();
expect(getCustomerByIdSpy).toHaveBeenCalledWith(aggregatorLinkRequiredMock.customerId);

// Should not to get the existing user
expect(getUserSpy).not.toHaveBeenCalled();

// get a linxo connect client token
expect(geClientTokenSpy).toHaveBeenCalledWith(
serviceAccountConfigMock.clientId,
Expand Down Expand Up @@ -258,7 +253,6 @@ describe('HookService', () => {
algoanCustomerService.getDefaultPassword(customerMock.id),
Env.sandbox,
);
expect(getUserSpy).toHaveBeenCalledWith(`user-token-${process.pid}`, `id-${process.pid}`, Env.sandbox);

// DO NOT get a linxo connect client token
expect(geClientTokenSpy).not.toHaveBeenCalled();
Expand Down Expand Up @@ -320,8 +314,6 @@ describe('HookService', () => {
algoanCustomerService.getDefaultPassword(customerMock.id),
Env.sandbox,
);
expect(getUserSpy).not.toHaveBeenCalled();

// BUT there is an error

// SO Connect to linxo connect as client
Expand Down
1 change: 0 additions & 1 deletion src/hooks/services/hooks.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export class HooksService {
this.algoanCustomerService.getDefaultPassword(customer.id),
env,
);
await this.linxoConnectUserService.getUser(userAccessToken, linxoConnectUserId, env);
} catch (e) {
// the user doesn't exist anymore
userAccessToken = undefined;
Expand Down

0 comments on commit 15ba13d

Please sign in to comment.