Skip to content

Commit

Permalink
verify that code is being added to getaccesstoken call
Browse files Browse the repository at this point in the history
  • Loading branch information
yunakim714 committed Sep 19, 2024
1 parent b985f9d commit fc63054
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/static/helpers/IDPLoginHelper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('Social login user flow', () => {
nock(`https://${shortCode}.api.commercecloud.salesforce.com`)
.get(`/shopper/auth/v1/organizations/${organizationId}/oauth2/authorize`)
.query(true)
.reply(303, {message: 'Oh yes!'});
.reply(303, {response_body: 'response_body'}, {location: url});

const accessToken = await loginIDPUser(
mockSlasClient,
Expand All @@ -124,13 +124,13 @@ describe('Social login user flow', () => {
redirect_uri: 'redirect_uri',
client_id: 'client_id',
channel_id: 'site_id',
usid: 'usid',
usid: '048adcfb-aa93-4978-be9e-09cb569fdcb9',
code_verifier: expect.stringMatching(/./) as string,
code: expect.any(String) as string,
code: 'J2lHm0cgXmnXpwDhjhLoyLJBoUAlBfxDY-AhjqGMC-o',
dnt: 'false',
},
};
expect(getAccessTokenMock).toBeCalledWith(expectedReqOptions);
expect(accessToken).toBe(expectedTokenResponse);
})
});
});

0 comments on commit fc63054

Please sign in to comment.