|
119 | 119 | });
|
120 | 120 | });
|
121 | 121 |
|
122 |
| - describe('validateMenuExistance', function() { |
| 122 | + describe('validateMenuExistence', function() { |
123 | 123 | describe('when menuId not provided', function() {
|
124 | 124 | it('should throw menuId error', function() {
|
125 |
| - expect(menuService.validateMenuExistance).toThrowError('MenuId was not provided'); |
| 125 | + expect(menuService.validateMenuExistence).toThrowError('MenuId was not provided'); |
126 | 126 | });
|
127 | 127 | });
|
128 | 128 |
|
129 | 129 | describe('when menu does not exist', function() {
|
130 | 130 | it('should throw no menu error', function() {
|
131 | 131 | var target = function() {
|
132 |
| - menuService.validateMenuExistance('noMenuId'); |
| 132 | + menuService.validateMenuExistence('noMenuId'); |
133 | 133 | };
|
134 | 134 | expect(target).toThrowError('Menu does not exist');
|
135 | 135 | });
|
|
142 | 142 | });
|
143 | 143 |
|
144 | 144 | it('should return truthy', function() {
|
145 |
| - expect(menuService.validateMenuExistance(menuId)).toBeTruthy(); |
| 145 | + expect(menuService.validateMenuExistence(menuId)).toBeTruthy(); |
146 | 146 | });
|
147 | 147 | });
|
148 | 148 | });
|
|
153 | 153 | };
|
154 | 154 | beforeEach(function() {
|
155 | 155 | menuService.menus[menu.id] = menu;
|
156 |
| - menuService.validateMenuExistance = jasmine.createSpy(); |
| 156 | + menuService.validateMenuExistence = jasmine.createSpy(); |
157 | 157 | menuService.removeMenu(menu.id);
|
158 | 158 | });
|
159 | 159 |
|
|
162 | 162 | });
|
163 | 163 |
|
164 | 164 | it('validates menu existance before removing', function() {
|
165 |
| - expect(menuService.validateMenuExistance).toHaveBeenCalledWith(menu.id); |
| 165 | + expect(menuService.validateMenuExistence).toHaveBeenCalledWith(menu.id); |
166 | 166 | });
|
167 | 167 | });
|
168 | 168 |
|
|
188 | 188 | menuItem;
|
189 | 189 |
|
190 | 190 | beforeEach(function() {
|
191 |
| - menuService.validateMenuExistance = jasmine.createSpy(); |
| 191 | + menuService.validateMenuExistence = jasmine.createSpy(); |
192 | 192 | menuService.addSubMenuItem = jasmine.createSpy();
|
193 | 193 | menuService.addMenu(menuId, {
|
194 | 194 | roles: ['a', 'b']
|
|
198 | 198 | });
|
199 | 199 |
|
200 | 200 | it('should validate menu existance', function() {
|
201 |
| - expect(menuService.validateMenuExistance).toHaveBeenCalledWith(menuId); |
| 201 | + expect(menuService.validateMenuExistence).toHaveBeenCalledWith(menuId); |
202 | 202 | });
|
203 | 203 |
|
204 | 204 | it('should return the menu', function() {
|
|
278 | 278 | menuService.addMenu(menuId);
|
279 | 279 | menuService.addMenuItem(menuId, { state: menuItemState });
|
280 | 280 | menuService.addMenuItem(menuId, { state: menuItemState2 });
|
281 |
| - menuService.validateMenuExistance = jasmine.createSpy(); |
| 281 | + menuService.validateMenuExistence = jasmine.createSpy(); |
282 | 282 | menu = menuService.removeMenuItem(menuId, menuItemState);
|
283 | 283 | });
|
284 | 284 |
|
|
287 | 287 | });
|
288 | 288 |
|
289 | 289 | it('should validate menu existance', function() {
|
290 |
| - expect(menuService.validateMenuExistance).toHaveBeenCalledWith(menuId); |
| 290 | + expect(menuService.validateMenuExistence).toHaveBeenCalledWith(menuId); |
291 | 291 | });
|
292 | 292 |
|
293 | 293 | it('should remove sub menu items with same state', function() {
|
|
324 | 324 | menu;
|
325 | 325 |
|
326 | 326 | beforeEach(function() {
|
327 |
| - menuService.validateMenuExistance = jasmine.createSpy(); |
| 327 | + menuService.validateMenuExistence = jasmine.createSpy(); |
328 | 328 | menuService.addMenu(menuId);
|
329 | 329 | menuService.addMenuItem(menuId, menuItem1Options);
|
330 | 330 | menuService.addMenuItem(menuId, menuItem2Options);
|
|
347 | 347 | });
|
348 | 348 |
|
349 | 349 | it('should validate menu existance', function() {
|
350 |
| - expect(menuService.validateMenuExistance).toHaveBeenCalledWith(menuId); |
| 350 | + expect(menuService.validateMenuExistence).toHaveBeenCalledWith(menuId); |
351 | 351 | });
|
352 | 352 |
|
353 | 353 | it('should not add sub menu item to menu item of different state', function() {
|
|
408 | 408 |
|
409 | 409 | describe('then removeSubMenuItem', function() {
|
410 | 410 | beforeEach(function() {
|
411 |
| - menuService.validateMenuExistance = jasmine.createSpy(); |
| 411 | + menuService.validateMenuExistence = jasmine.createSpy(); |
412 | 412 | menu = menuService.removeSubMenuItem(menuId, subItem1.state);
|
413 | 413 | });
|
414 | 414 |
|
415 | 415 | it('should validate menu existance', function() {
|
416 |
| - expect(menuService.validateMenuExistance).toHaveBeenCalledWith(menuId); |
| 416 | + expect(menuService.validateMenuExistence).toHaveBeenCalledWith(menuId); |
417 | 417 | });
|
418 | 418 |
|
419 | 419 | it('should return menu object', function() {
|
|
0 commit comments