Skip to content
Snippets Groups Projects
Commit c7ff737b authored by OZGCloud's avatar OZGCloud
Browse files

OZG-3574 add missing Tests(TDD)

parent 8d77efb6
No related branches found
No related tags found
No related merge requests found
......@@ -85,11 +85,29 @@ describe('VorgangService', () => {
repository.getVorgang.mockReturnValue(cold('a', { a: vorgangWithEingang }));
})
it('should set resource loading', () => {
service.setStateResourceOnLoading = jest.fn();
service.loadVorgangWithEingang(url);
expect(service.setStateResourceOnLoading).toHaveBeenCalled();
})
it('should call repository', () => {
service.loadVorgangWithEingang(url);
expect(repository.getVorgang).toHaveBeenCalledWith(url);
})
it('should update vorgang', () => {
service.updateVorgang = jest.fn();
const vorgangWithEingang: VorgangWithEingangResource = createVorgangWithEingangResource();
repository.getVorgang.mockReturnValue(of(vorgangWithEingang));
service.loadVorgangWithEingang(url);
expect(service.updateVorgang).toHaveBeenCalledWith(vorgangWithEingang);
})
})
describe('updateVorgang', () => {
......@@ -99,6 +117,15 @@ describe('VorgangService', () => {
service.loadAttachments = jest.fn();
})
it('should setVorgangWithEingang', () => {
service.setVorgangWithEingang = jest.fn();
const vorgangWithEingang: VorgangWithEingangResource = createVorgangWithEingangResource();
service.updateVorgang(vorgangWithEingang);
expect(service.setVorgangWithEingang).toHaveBeenCalledWith(createStateResource(vorgangWithEingang));
})
it('should load pendingCommands', () => {
service.updateVorgang(createVorgangWithEingangResource());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment