@@ -20,7 +20,7 @@ define([
20
20
defaultContext = require . s . contexts . _ ,
21
21
menuItem = $ (
22
22
'<li class="level0 category-item">' +
23
- '<a href="http://localhost.com/cat1.html" id="ui-id-3" >Cat1</a>' +
23
+ '<a href="http://localhost.com/cat1.html">Cat1</a>' +
24
24
'</li>'
25
25
) [ 0 ] ,
26
26
@@ -116,14 +116,14 @@ define([
116
116
} ) ;
117
117
118
118
it ( 'Check _getCategoryCrumb call' , function ( ) {
119
- var item = $ ( '<a href="http://localhost.com/cat1.html" id="ui-id-3" >Cat1</a>' ) ;
119
+ var item = $ ( '<a href="http://localhost.com/cat1.html">Cat1</a>' ) ;
120
120
121
121
expect ( widget ) . toBeDefined ( ) ;
122
122
expect ( widget ) . toEqual ( jasmine . any ( Function ) ) ;
123
123
expect ( widget . prototype . _getCategoryCrumb ) . toBeDefined ( ) ;
124
124
expect ( widget . prototype . _getCategoryCrumb ( item ) ) . toEqual ( jasmine . objectContaining (
125
125
{
126
- 'name' : 'category3 ' ,
126
+ 'name' : 'category ' ,
127
127
'label' : 'Cat1' ,
128
128
'link' : 'http://localhost.com/cat1.html'
129
129
}
@@ -232,7 +232,7 @@ define([
232
232
expect ( result . length ) . toBe ( 1 ) ;
233
233
expect ( result [ 0 ] ) . toEqual ( jasmine . objectContaining (
234
234
{
235
- 'name' : 'category3 ' ,
235
+ 'name' : 'category ' ,
236
236
'label' : 'Cat1' ,
237
237
'link' : 'http://localhost.com/cat1.html'
238
238
}
@@ -243,10 +243,10 @@ define([
243
243
var result ,
244
244
menuItems = $ (
245
245
'<li class="level0 nav-1">' +
246
- '<a href="http://localhost.com/cat1.html" id="ui-id-3" >cat1</a>' +
246
+ '<a href="http://localhost.com/cat1.html">cat1</a>' +
247
247
'<ul>' +
248
248
'<li class="level1 nav-1-1">' +
249
- '<a href="http://localhost.com/cat1/cat21.html" id="ui-id-9" >cat21</a>' +
249
+ '<a href="http://localhost.com/cat1/cat21.html">cat21</a>' +
250
250
'</li>' +
251
251
'</ul>' +
252
252
'</li>'
@@ -262,14 +262,14 @@ define([
262
262
263
263
context = createContext ( widget . prototype ) ;
264
264
getParentMenuHandler = widget . prototype . _getParentMenuItem . bind ( context ) ;
265
- result = getParentMenuHandler ( $ ( '#ui-id-9 ' ) ) ;
265
+ result = getParentMenuHandler ( $ ( '[href="http://localhost.com/cat1/cat21.html"] ' ) ) ;
266
266
267
267
expect ( result ) . toBeDefined ( ) ;
268
268
expect ( result . length ) . toBe ( 1 ) ;
269
269
expect ( result [ 0 ] . tagName . toLowerCase ( ) ) . toEqual ( 'a' ) ;
270
- expect ( result . attr ( 'id ' ) ) . toEqual ( 'ui-id-3 ' ) ;
270
+ expect ( result . attr ( 'href ' ) ) . toEqual ( 'http://localhost.com/cat1.html ' ) ;
271
271
272
- result = getParentMenuHandler ( $ ( '#ui-id-3 ' ) ) ;
272
+ result = getParentMenuHandler ( $ ( '[href="http://localhost.com/cat1.html"] ' ) ) ;
273
273
274
274
expect ( result ) . toBeNull ( ) ;
275
275
} ) ;
0 commit comments