Mark Lenser pushed to branch feature/cmng-psp1-CHANNELMGR-699 at cms-community / hippo-addon-channel-manager
Commits: a5cabf32 by Mark at 2016-05-30T17:04:41+02:00 CHANNELMGR-699: tests for hasLocalParameters - - - - - 1 changed file: - frontend-ng/src/angularjs/channel/menu/editor.spec.js Changes: ===================================== frontend-ng/src/angularjs/channel/menu/editor.spec.js ===================================== --- a/frontend-ng/src/angularjs/channel/menu/editor.spec.js +++ b/frontend-ng/src/angularjs/channel/menu/editor.spec.js @@ -74,5 +74,27 @@ describe('MenuEditor', () => { $element.find('.qa-button-back').click(); expect($scope.onDone).toHaveBeenCalled(); }); -}); + describe('MenuEditorCtrl', () => { + describe('hasLocalParameters', () => { + it('returns false if there are not local parameters', () => { + const MenuEditorCtrl = compileDirectiveAndGetController(); + MenuEditorCtrl.editingItem = { + id: 1, + localParameters: {}, + }; + expect(MenuEditorCtrl.hasLocalParameters()).toBe(false); + }); + it('returns true if there are local parameters', () => { + const MenuEditorCtrl = compileDirectiveAndGetController(); + MenuEditorCtrl.editingItem = { + id: 1, + localParameters: { + test: 1, + }, + }; + expect(MenuEditorCtrl.hasLocalParameters()).toBe(true); + }); + }); + }); +}); View it on GitLab: https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/a5cabf32b7e7c36eb90c72923bc31dab9d23aaac
_______________________________________________ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn