@@ -37,10 +37,10 @@ describe('GraphMap openlayers', () => {
3737 }
3838 } ) ;
3939 var graphMap = new GraphMap ( knowledgegraphmapURL ) ;
40- graphMap . on ( 'loaded' , ( ) => {
40+ graphMap . on ( 'loaded' , ( ) => {
4141 expect ( graphMap ) . not . toBeNull ( ) ;
4242 done ( ) ;
43- } )
43+ } ) ;
4444 } ) ;
4545 it ( 'findShortestPath' , ( done ) => {
4646 spyOn ( FetchRequest , 'get' ) . and . callFake ( ( testUrl ) => {
@@ -63,18 +63,18 @@ describe('GraphMap openlayers', () => {
6363 expect ( graphMap ) . not . toBeNull ( ) ;
6464 spyOn ( graphMap . graph , 'highlight' ) ;
6565 spyOn ( graphMap . graph , 'clearHighlight' ) ;
66- knowledgeGraphService . findShortestPath ( { startid : 38756 , endid : 38757 } , ( res ) => {
66+ graphMap . findShortestPath ( { startid : 38756 , endid : 38757 } , ( res ) => {
6767 expect ( res ) . not . toBeNull ( ) ;
6868 expect ( res . type ) . toBe ( 'processCompleted' ) ;
6969 expect ( res . result ) . not . toBeNull ( ) ;
7070 expect ( res . result . nodeIDs ) . toEqual ( [ 40229 , 40237 , 64058 ] ) ;
7171 expect ( res . result . edgeIDs ) . toEqual ( [ 69575 , 66619 ] ) ;
72+ graphMap . highlight ( { nodeIDs : [ 40229 ] , edgeIDs : [ 69575 ] } ) ;
73+ expect ( graphMap . graph . highlight ) . toHaveBeenCalled ( ) ;
74+ graphMap . clearHighlight ( { nodeIDs : [ 40229 ] , edgeIDs : [ 69575 ] } ) ;
75+ expect ( graphMap . graph . clearHighlight ) . toHaveBeenCalled ( ) ;
76+ done ( ) ;
7277 } ) ;
73- graphMap . highlight ( { nodeIDs : [ 40229 ] , edgeIDs : [ 69575 ] } ) ;
74- expect ( graphMap . graph . highlight ) . toHaveBeenCalled ( ) ;
75- graphMap . clearHighlight ( { nodeIDs : [ 40229 ] , edgeIDs : [ 69575 ] } ) ;
76- expect ( graphMap . graph . clearHighlight ) . toHaveBeenCalled ( ) ;
77- done ( ) ;
7878 } catch ( exception ) {
7979 console . log ( "'findShortestPath'案例失败:" + exception . name + ':' + exception . message ) ;
8080 expect ( false ) . toBeTruthy ( ) ;
0 commit comments