Tobias Jeger pushed to branch feature/cmng-psp1-CHANNELMGR-610 at cms-community / hippo-addon-channel-manager
Commits: 7d084f25 by Tobias Jeger at 2016-04-22T10:50:34+02:00 CHANNELMGR-610 Test the return value of the changes HstService methods - - - - - 1 changed file: - frontend-ng/src/angularjs/api/hst.service.spec.js Changes: ===================================== frontend-ng/src/angularjs/api/hst.service.spec.js ===================================== --- a/frontend-ng/src/angularjs/api/hst.service.spec.js +++ b/frontend-ng/src/angularjs/api/hst.service.spec.js @@ -235,19 +235,25 @@ describe('HstService', () => { }); it('removes an exist component from a container', () => { + const promiseSpy = jasmine.createSpy('promiseSpy'); const url = `${contextPath}${apiUrlPrefix}/container-1./component-foo`; $httpBackend.expectDELETE(url).respond(200); - hstService.removeHstComponent('container-1', 'component-foo'); + hstService.removeHstComponent('container-1', 'component-foo').then(promiseSpy); $httpBackend.flush(); + + expect(promiseSpy).toHaveBeenCalled(); }); it('updates component orders of a container', () => { + const promiseSpy = jasmine.createSpy('promiseSpy'); const url = `${contextPath}${apiUrlPrefix}/container-1./`; $httpBackend.expectPUT(url, { foo: 'foo-value', baa: 'baah' }).respond(200); - hstService.updateHstComponent('container-1', { foo: 'foo-value', baa: 'baah' }); + hstService.updateHstComponent('container-1', { foo: 'foo-value', baa: 'baah' }).then(promiseSpy); $httpBackend.flush(); + + expect(promiseSpy).toHaveBeenCalled(); }); it('extracts the sitemap from the returned pages response', () => { View it on GitLab: https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/7d084f25ce3e8202a5bbc40ef6ca2b0e61440ee9
_______________________________________________ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn