@@ -880,7 +880,8 @@ describe('WebMapServiceSpec.js', () => {
880
880
let getFeatureBySQLParams ;
881
881
spyOn ( FetchRequest , 'post' ) . and . callFake ( ( url , options ) => {
882
882
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 ) ) ) ;
884
885
} ) ;
885
886
const type = 'rest_data' ;
886
887
const layer = {
@@ -894,13 +895,14 @@ describe('WebMapServiceSpec.js', () => {
894
895
const baseProjection = 'EPSG:3857' ;
895
896
const service = new WebMapService ( mapId , options ) ;
896
897
const spy = spyOn ( service , '_getFeatureBySQL' ) . and . callThrough ( ) ; ;
897
- service . getLayerFeatures ( type , layer , baseProjection ) . then ( ( ) => {
898
+ service . getLayerFeatures ( type , layer , baseProjection ) . then ( ( res ) => {
898
899
const params = spy . calls . allArgs ( ) [ 0 ] ;
899
900
expect ( params [ 0 ] ) . toBe ( layer . dataSource . url ) ;
900
901
expect ( params [ 1 ] ) . toEqual ( [ "中国矢量数据:飞机场" ] ) ;
901
902
expect ( params [ 4 ] ) . toEqual ( baseProjection ) ;
902
903
expect ( typeof getFeatureBySQLParams ) . toBe ( 'string' ) ;
903
904
expect ( getFeatureBySQLParams ) . toContain ( `'targetEpsgCode':4326` ) ;
905
+ expect ( res . features instanceof Array ) . toBeTruthy ( ) ;
904
906
done ( ) ;
905
907
} ) ;
906
908
} ) ;
0 commit comments