Skip to content
This repository was archived by the owner on Aug 30, 2021. It is now read-only.

Commit fde27f0

Browse files
amanmavailirantal
authored andcommitted
fix(core): Typo in menu.client.service.js (#1355)
* fixed typo in modules/core/client/services/menu.client.service.js * fixed typo in modules/core/tests/client/menu.client.service.tests.js
1 parent c8cbcd3 commit fde27f0

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

modules/core/client/services/menu.client.service.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
removeMenu: removeMenu,
1818
removeMenuItem: removeMenuItem,
1919
removeSubMenuItem: removeSubMenuItem,
20-
validateMenuExistance: validateMenuExistance
20+
validateMenuExistence: validateMenuExistence
2121
};
2222

2323
init();
@@ -44,7 +44,7 @@
4444
options = options || {};
4545

4646
// Validate that the menu exists
47-
service.validateMenuExistance(menuId);
47+
service.validateMenuExistence(menuId);
4848

4949
// Push new menu item
5050
service.menus[menuId].items.push({
@@ -76,7 +76,7 @@
7676
options = options || {};
7777

7878
// Validate that the menu exists
79-
service.validateMenuExistance(menuId);
79+
service.validateMenuExistence(menuId);
8080

8181
// Search for menu item
8282
for (var itemIndex in service.menus[menuId].items) {
@@ -99,7 +99,7 @@
9999
// Get the menu object by menu id
100100
function getMenu(menuId) {
101101
// Validate that the menu exists
102-
service.validateMenuExistance(menuId);
102+
service.validateMenuExistence(menuId);
103103

104104
// Return the menu object
105105
return service.menus[menuId];
@@ -138,15 +138,15 @@
138138
// Remove existing menu object by menu id
139139
function removeMenu(menuId) {
140140
// Validate that the menu exists
141-
service.validateMenuExistance(menuId);
141+
service.validateMenuExistence(menuId);
142142

143143
delete service.menus[menuId];
144144
}
145145

146146
// Remove existing menu object by menu id
147147
function removeMenuItem(menuId, menuItemState) {
148148
// Validate that the menu exists
149-
service.validateMenuExistance(menuId);
149+
service.validateMenuExistence(menuId);
150150

151151
// Search for menu item to remove
152152
for (var itemIndex in service.menus[menuId].items) {
@@ -162,7 +162,7 @@
162162
// Remove existing menu object by menu id
163163
function removeSubMenuItem(menuId, submenuItemState) {
164164
// Validate that the menu exists
165-
service.validateMenuExistance(menuId);
165+
service.validateMenuExistence(menuId);
166166

167167
// Search for menu item to remove
168168
for (var itemIndex in service.menus[menuId].items) {
@@ -180,7 +180,7 @@
180180
}
181181

182182
// Validate menu existance
183-
function validateMenuExistance(menuId) {
183+
function validateMenuExistence(menuId) {
184184
if (menuId && menuId.length) {
185185
if (service.menus[menuId]) {
186186
return true;

modules/core/tests/client/menus.client.service.tests.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,17 @@
119119
});
120120
});
121121

122-
describe('validateMenuExistance', function() {
122+
describe('validateMenuExistence', function() {
123123
describe('when menuId not provided', function() {
124124
it('should throw menuId error', function() {
125-
expect(menuService.validateMenuExistance).toThrowError('MenuId was not provided');
125+
expect(menuService.validateMenuExistence).toThrowError('MenuId was not provided');
126126
});
127127
});
128128

129129
describe('when menu does not exist', function() {
130130
it('should throw no menu error', function() {
131131
var target = function() {
132-
menuService.validateMenuExistance('noMenuId');
132+
menuService.validateMenuExistence('noMenuId');
133133
};
134134
expect(target).toThrowError('Menu does not exist');
135135
});
@@ -142,7 +142,7 @@
142142
});
143143

144144
it('should return truthy', function() {
145-
expect(menuService.validateMenuExistance(menuId)).toBeTruthy();
145+
expect(menuService.validateMenuExistence(menuId)).toBeTruthy();
146146
});
147147
});
148148
});
@@ -153,7 +153,7 @@
153153
};
154154
beforeEach(function() {
155155
menuService.menus[menu.id] = menu;
156-
menuService.validateMenuExistance = jasmine.createSpy();
156+
menuService.validateMenuExistence = jasmine.createSpy();
157157
menuService.removeMenu(menu.id);
158158
});
159159

@@ -162,7 +162,7 @@
162162
});
163163

164164
it('validates menu existance before removing', function() {
165-
expect(menuService.validateMenuExistance).toHaveBeenCalledWith(menu.id);
165+
expect(menuService.validateMenuExistence).toHaveBeenCalledWith(menu.id);
166166
});
167167
});
168168

@@ -188,7 +188,7 @@
188188
menuItem;
189189

190190
beforeEach(function() {
191-
menuService.validateMenuExistance = jasmine.createSpy();
191+
menuService.validateMenuExistence = jasmine.createSpy();
192192
menuService.addSubMenuItem = jasmine.createSpy();
193193
menuService.addMenu(menuId, {
194194
roles: ['a', 'b']
@@ -198,7 +198,7 @@
198198
});
199199

200200
it('should validate menu existance', function() {
201-
expect(menuService.validateMenuExistance).toHaveBeenCalledWith(menuId);
201+
expect(menuService.validateMenuExistence).toHaveBeenCalledWith(menuId);
202202
});
203203

204204
it('should return the menu', function() {
@@ -278,7 +278,7 @@
278278
menuService.addMenu(menuId);
279279
menuService.addMenuItem(menuId, { state: menuItemState });
280280
menuService.addMenuItem(menuId, { state: menuItemState2 });
281-
menuService.validateMenuExistance = jasmine.createSpy();
281+
menuService.validateMenuExistence = jasmine.createSpy();
282282
menu = menuService.removeMenuItem(menuId, menuItemState);
283283
});
284284

@@ -287,7 +287,7 @@
287287
});
288288

289289
it('should validate menu existance', function() {
290-
expect(menuService.validateMenuExistance).toHaveBeenCalledWith(menuId);
290+
expect(menuService.validateMenuExistence).toHaveBeenCalledWith(menuId);
291291
});
292292

293293
it('should remove sub menu items with same state', function() {
@@ -324,7 +324,7 @@
324324
menu;
325325

326326
beforeEach(function() {
327-
menuService.validateMenuExistance = jasmine.createSpy();
327+
menuService.validateMenuExistence = jasmine.createSpy();
328328
menuService.addMenu(menuId);
329329
menuService.addMenuItem(menuId, menuItem1Options);
330330
menuService.addMenuItem(menuId, menuItem2Options);
@@ -347,7 +347,7 @@
347347
});
348348

349349
it('should validate menu existance', function() {
350-
expect(menuService.validateMenuExistance).toHaveBeenCalledWith(menuId);
350+
expect(menuService.validateMenuExistence).toHaveBeenCalledWith(menuId);
351351
});
352352

353353
it('should not add sub menu item to menu item of different state', function() {
@@ -408,12 +408,12 @@
408408

409409
describe('then removeSubMenuItem', function() {
410410
beforeEach(function() {
411-
menuService.validateMenuExistance = jasmine.createSpy();
411+
menuService.validateMenuExistence = jasmine.createSpy();
412412
menu = menuService.removeSubMenuItem(menuId, subItem1.state);
413413
});
414414

415415
it('should validate menu existance', function() {
416-
expect(menuService.validateMenuExistance).toHaveBeenCalledWith(menuId);
416+
expect(menuService.validateMenuExistence).toHaveBeenCalledWith(menuId);
417417
});
418418

419419
it('should return menu object', function() {

0 commit comments

Comments
 (0)