[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

@@ -17,6 +17,7 @@ import { HALEndpointService } from '../shared/hal-endpoint.service';
import { JsonPatchOperationsEntry, JsonPatchOperationsResourceEntry } from './json-patch-operations.reducer';
import {
CommitPatchOperationsAction,
DeletePendingJsonPatchOperationsAction,
RollbacktPatchOperationsAction,
StartTransactionPatchOperationsAction
} from './json-patch-operations.actions';
@@ -288,4 +289,19 @@ describe('JsonPatchOperationsService test suite', () => {
});
});
describe('deletePendingJsonPatchOperations', () => {
beforeEach(() => {
store.dispatch.and.callFake(() => { /* */ });
});
it('should dispatch a new DeletePendingJsonPatchOperationsAction', () => {
const expectedAction = new DeletePendingJsonPatchOperationsAction();
scheduler.schedule(() => service.deletePendingJsonPatchOperations());
scheduler.flush();
expect(store.dispatch).toHaveBeenCalledWith(expectedAction);
});
});
});