Merge pull request #1272 from Safelite/feature/jzimmerman/load_session_missingsavedsessionid_fix
Added savedsessionid to the load session call
This commit is contained in:
commit
3e32b7683c
2 changed files with 10 additions and 3 deletions
|
|
@ -1618,11 +1618,14 @@ export const useMainStore = defineStore({
|
|||
});
|
||||
},
|
||||
async loadSession(duplicate) {
|
||||
const { order } = this;
|
||||
const { applicationUser, order } = this;
|
||||
// NOTE: We are re-using the current user's saved session id (this is required on the load-session call).
|
||||
// This should be ok, but should probably validate.
|
||||
const response = await globalMethods.callHttpClient({
|
||||
method: endpoints.LoadSession.method,
|
||||
endpoint: endpoints.LoadSession.url,
|
||||
payload: {
|
||||
savedSessionId: applicationUser.savedSessionId,
|
||||
referralNumber: duplicate.referralNumber,
|
||||
referralDate: duplicate.referralDate,
|
||||
parentAccountNumber: order.parentAccountNumber,
|
||||
|
|
|
|||
|
|
@ -2236,12 +2236,14 @@ describe('Store', () => {
|
|||
describe('loadSession method', () => {
|
||||
let mockDuplicate;
|
||||
let mockResponse;
|
||||
let savedSessionId = getRandomGuid();
|
||||
|
||||
beforeEach(() => {
|
||||
mockDuplicate = {
|
||||
referralNumber: getRandomString(10, 10),
|
||||
referralDate: new Date().toISOString(),
|
||||
correlationId: getRandomGuid()
|
||||
correlationId: getRandomGuid(),
|
||||
savedSessionId: savedSessionId
|
||||
};
|
||||
|
||||
mockResponse = {
|
||||
|
|
@ -2291,6 +2293,7 @@ describe('Store', () => {
|
|||
it('should call callHttpClient with correct parameters', async () => {
|
||||
// Arrange
|
||||
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve(mockResponse));
|
||||
store.applicationUser.savedSessionId = savedSessionId;
|
||||
|
||||
// Act
|
||||
await store.loadSession(mockDuplicate);
|
||||
|
|
@ -2300,6 +2303,7 @@ describe('Store', () => {
|
|||
method: endpoints.LoadSession.method,
|
||||
endpoint: endpoints.LoadSession.url,
|
||||
payload: {
|
||||
savedSessionId: mockDuplicate.savedSessionId,
|
||||
referralNumber: mockDuplicate.referralNumber,
|
||||
referralDate: mockDuplicate.referralDate,
|
||||
parentAccountNumber: store.order.parentAccountNumber,
|
||||
|
|
|
|||
Loading…
Reference in a new issue