Skip to content

Commit

Permalink
Reverting test change
Browse files Browse the repository at this point in the history
  • Loading branch information
glenfannin-okta committed Apr 25, 2024
1 parent 069379a commit 4d803fe
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions test/spec/idx/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,27 +372,13 @@ describe('idx/run', () => {
idxResponse.requestDidSucceed = false;
});

// Do not save the response if it is not a rawIdxResponse. Use previous saved IDX resposne to continue
it('does not save the idxResponse when it is not a rawIdxResponse', async () =>{
// Do not save the failed response. Use previous saved IDX resposne to continue
it('does not save the idxResponse', async () =>{
const { authClient, idxResponse } = testContext;
idxResponse.requestDidSucceed = false;
jest.spyOn(authClient.transactionManager, 'saveIdxResponse');
await run(authClient);
expect(authClient.transactionManager.saveIdxResponse).toHaveBeenCalled();
});

// Will save the idxResponse if it is a rawIdxResponse, even if the response failed
it('saves idxResponse', async () => {
const { authClient, idxResponse, transactionMeta } = testContext;
idxResponse.requestDidSucceed = false;
jest.spyOn(authClient.transactionManager, 'saveIdxResponse');
await run(authClient);
expect(authClient.transactionManager.saveIdxResponse).toHaveBeenCalledWith({
rawIdxResponse: idxResponse.rawIdxState,
requestDidSucceed: false,
stateHandle: idxResponse.context.stateHandle,
interactionHandle: transactionMeta.interactionHandle
});
expect(authClient.transactionManager.saveIdxResponse).not.toHaveBeenCalled();
});

// an error response does not clear the transaction. options may be valid on previous response
Expand Down Expand Up @@ -640,14 +626,6 @@ describe('idx/run', () => {
await run(authClient);
expect(authClient.transactionManager.saveIdxResponse).not.toHaveBeenCalled();
});
it('does not save the idxResponse when it is not a rawIdxResponse', async () => {
const { authClient, idxResponse } = testContext;
idxResponse.requestDidSucceed = false;
idxResponse.rawIdxState.version = null;
jest.spyOn(authClient.transactionManager, 'saveIdxResponse');
await run(authClient);
expect(authClient.transactionManager.saveIdxResponse).not.toHaveBeenCalled();
});
it('saves the idxResponse when has actions', async () => {
const { idxResponse, authClient } = testContext;
idxResponse.actions = {
Expand Down

0 comments on commit 4d803fe

Please sign in to comment.