Canh Ngo pushed to branch feature/cmng-psp1-CHANNELMGR-616 at cms-community / hippo-addon-channel-manager
Commits: de2af691 by Canh Ngo at 2016-04-29T15:09:42+02:00 CHANNELMGR-616: printed console log when it fails to get channel - - - - - 2 changed files: - frontend-ng/src/angularjs/channel/channel.service.js - frontend-ng/src/angularjs/channel/channel.service.spec.js Changes: ===================================== frontend-ng/src/angularjs/channel/channel.service.js ===================================== --- a/frontend-ng/src/angularjs/channel/channel.service.js +++ b/frontend-ng/src/angularjs/channel/channel.service.js @@ -40,6 +40,9 @@ export class ChannelService { this.HstService.getChannel(this.channel.id) .then((channel) => { this._setChannel(channel); + }) + .catch(() => { + this.$log.error(`Cannot retrieve properties of the channel with id = "${this.channel.id}" from server`); }); }); } ===================================== frontend-ng/src/angularjs/channel/channel.service.spec.js ===================================== --- a/frontend-ng/src/angularjs/channel/channel.service.spec.js +++ b/frontend-ng/src/angularjs/channel/channel.service.spec.js @@ -340,6 +340,20 @@ describe('ChannelService', () => { expect(ChannelService.channel.changedBySet).toEqual(['anotherUser']); }); + it('prints console log when it is failed to update current channel as requested by Ext', () => { + ChannelService._load(channelMock); + $rootScope.$digest(); + + channelMock.changedBySet = ['anotherUser']; + HstService.getChannel.and.returnValue($q.reject()); + spyOn($log, 'error'); + + window.CMS_TO_APP.publish('channel-changed-in-extjs'); + $rootScope.$digest(); + + expect($log.error).toHaveBeenCalled(); + }); + it('should update the channel\'s preview config flag after successfully creating the preview config', () => { channelMock.previewHstConfigExists = false; ChannelService._load(channelMock); View it on GitLab: https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/de2af6919d7c420098433ce9fcaba95c5d6f8ae6
_______________________________________________ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn