[DSC-76] Delete pending json patch operations

This commit is contained in:
Alessandro Martelli
2021-05-28 13:19:59 +02:00
parent ddb7d5181f
commit da4be7b57f
8 changed files with 93 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
import * as deepFreeze from 'deep-freeze';
import {
CommitPatchOperationsAction,
CommitPatchOperationsAction, DeletePendingJsonPatchOperationsAction,
FlushPatchOperationsAction,
NewPatchAddOperationAction,
NewPatchRemoveOperationAction,
@@ -323,4 +323,19 @@ describe('jsonPatchOperationsReducer test suite', () => {
});
describe('When DeletePendingJsonPatchOperationsAction has been dispatched', () => {
it('should set set the JsonPatchOperationsState to null ', () => {
const action = new DeletePendingJsonPatchOperationsAction();
initState = Object.assign({}, testState, {
[testJsonPatchResourceType]: Object.assign({}, testState[testJsonPatchResourceType], {
transactionStartTime: startTimestamp,
commitPending: true
})
});
const newState = jsonPatchOperationsReducer(initState, action);
expect(newState).toBeNull();
});
});
});