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', () => {
308308 graphThemeLayer . setVisibility ( false ) ;
309309 expect ( graphThemeLayer . visibility ) . toBeFalsy ( ) ;
310310 } ) ;
311-
311+
312312 it ( 'moveTo' , ( ) => {
313313 const graphThemeLayer = new Graph ( "GraphThemeLayer" , "Bar" , {
314314 map : map ,
@@ -322,6 +322,7 @@ describe('mapboxgl_GraphThemeLayer', () => {
322322 charts : [ 1 , 2 , 3 ] ,
323323 cache : { 'name' : 'ONETWO' }
324324 } ) ;
325+ var length1 = graphThemeLayer . div . parentNode . getElementsByClassName ( "themeLayer" ) . length ;
325326 //ThemeLayer 75行已经添加过一次了
326327 // map.addLayer(graphThemeLayer);
327328 const graphThemeLayer2 = new Graph ( "GraphThemeLayer2" , "Bar" , {
@@ -338,9 +339,9 @@ describe('mapboxgl_GraphThemeLayer', () => {
338339 } ) ;
339340 //ThemeLayer 75行已经添加过一次了
340341 // 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 ) ;
343344 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 ) ;
345346 } ) ;
346347} ) ;
You can’t perform that action at this time.
0 commit comments