File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -308,7 +308,7 @@ describe('mapboxgl_GraphThemeLayer', () => {
308
308
graphThemeLayer . setVisibility ( false ) ;
309
309
expect ( graphThemeLayer . visibility ) . toBeFalsy ( ) ;
310
310
} ) ;
311
-
311
+
312
312
it ( 'moveTo' , ( ) => {
313
313
const graphThemeLayer = new Graph ( "GraphThemeLayer" , "Bar" , {
314
314
map : map ,
@@ -322,6 +322,7 @@ describe('mapboxgl_GraphThemeLayer', () => {
322
322
charts : [ 1 , 2 , 3 ] ,
323
323
cache : { 'name' : 'ONETWO' }
324
324
} ) ;
325
+ var length1 = graphThemeLayer . div . parentNode . getElementsByClassName ( "themeLayer" ) . length ;
325
326
//ThemeLayer 75行已经添加过一次了
326
327
// map.addLayer(graphThemeLayer);
327
328
const graphThemeLayer2 = new Graph ( "GraphThemeLayer2" , "Bar" , {
@@ -338,9 +339,9 @@ describe('mapboxgl_GraphThemeLayer', () => {
338
339
} ) ;
339
340
//ThemeLayer 75行已经添加过一次了
340
341
// map.addLayer(graphThemeLayer2);
341
- //移动前,第一个layer是第一个
342
- expect ( graphThemeLayer . div . parentNode . getElementsByClassName ( "themeLayer" ) [ 0 ] . id ) . toEqual ( graphThemeLayer . id ) ;
342
+ //移动前,第一个layer是倒数第二个
343
+ expect ( graphThemeLayer . div . parentNode . getElementsByClassName ( "themeLayer" ) [ length1 - 1 ] . id ) . toEqual ( graphThemeLayer . id ) ;
343
344
graphThemeLayer2 . moveTo ( graphThemeLayer . id ) ;
344
- expect ( graphThemeLayer . div . parentNode . getElementsByClassName ( "themeLayer" ) [ 0 ] . id ) . toEqual ( graphThemeLayer2 . id ) ;
345
+ expect ( graphThemeLayer . div . parentNode . getElementsByClassName ( "themeLayer" ) [ length1 - 1 ] . id ) . toEqual ( graphThemeLayer2 . id ) ;
345
346
} ) ;
346
347
} ) ;
You can’t perform that action at this time.
0 commit comments