@@ -880,7 +880,8 @@ describe('WebMapServiceSpec.js', () => {
880880 let getFeatureBySQLParams ;
881881 spyOn ( FetchRequest , 'post' ) . and . callFake ( ( url , options ) => {
882882 getFeatureBySQLParams = options ;
883- return Promise . resolve ( new Response ( JSON . stringify ( REST_DATA_SQL_RESULT ) ) ) ;
883+ expect ( url . includes ( 'returnFeaturesOnly=true' ) ) . toBeTruthy ( )
884+ return Promise . resolve ( new Response ( JSON . stringify ( REST_DATA_SQL_RESULT . features ) ) ) ;
884885 } ) ;
885886 const type = 'rest_data' ;
886887 const layer = {
@@ -894,13 +895,14 @@ describe('WebMapServiceSpec.js', () => {
894895 const baseProjection = 'EPSG:3857' ;
895896 const service = new WebMapService ( mapId , options ) ;
896897 const spy = spyOn ( service , '_getFeatureBySQL' ) . and . callThrough ( ) ; ;
897- service . getLayerFeatures ( type , layer , baseProjection ) . then ( ( ) => {
898+ service . getLayerFeatures ( type , layer , baseProjection ) . then ( ( res ) => {
898899 const params = spy . calls . allArgs ( ) [ 0 ] ;
899900 expect ( params [ 0 ] ) . toBe ( layer . dataSource . url ) ;
900901 expect ( params [ 1 ] ) . toEqual ( [ "中国矢量数据:飞机场" ] ) ;
901902 expect ( params [ 4 ] ) . toEqual ( baseProjection ) ;
902903 expect ( typeof getFeatureBySQLParams ) . toBe ( 'string' ) ;
903904 expect ( getFeatureBySQLParams ) . toContain ( `'targetEpsgCode':4326` ) ;
905+ expect ( res . features instanceof Array ) . toBeTruthy ( ) ;
904906 done ( ) ;
905907 } ) ;
906908 } ) ;
0 commit comments