@@ -109,7 +109,7 @@ describe('openlayers_ChartService', () => {
109109 if ( testUrl . indexOf ( "/gridValue" ) > - 1 ) {
110110 return Promise . resolve ( new Response ( JSON . stringify ( gridValue ) ) ) ;
111111 }
112- if ( testUrl . indexOf ( "S102_102YYYY000000000002_Group01_D " ) > - 1 ) {
112+ if ( testUrl . indexOf ( "S102_102YYYY000000000002_Group01 " ) > - 1 ) {
113113 return Promise . resolve ( new Response ( JSON . stringify ( datasetRes ) ) ) ;
114114 }
115115
@@ -119,9 +119,9 @@ describe('openlayers_ChartService', () => {
119119 const service2Res = service2 . getChartWaterDepth ( parms ) ;
120120 expect ( service2Res ) . toBeNull ( ) ;
121121 service . getChartWaterDepth ( parms ) . then ( res => {
122- expect ( res . result . value ) . toBe ( 12 )
123- expect ( res . result . row ) . toBe ( 845 )
124- expect ( res . result . column ) . toBe ( 385 )
122+ expect ( res . depth . result . value ) . toBe ( 12 )
123+ expect ( res . depth . result . row ) . toBe ( 845 )
124+ expect ( res . depth . result . column ) . toBe ( 385 )
125125 done ( ) ;
126126 } )
127127 } ) ;
@@ -178,6 +178,30 @@ describe('openlayers_ChartService', () => {
178178 done ( ) ;
179179 } )
180180 } ) ;
181+ it ( 'getChartMaritimePcInfo' , ( done ) => {
182+ var service = new ChartService ( url , dataUrl , options ) ;
183+ spyOn ( FetchRequest , 'commit' ) . and . callFake ( ( method , testUrl , params , options ) => {
184+ expect ( method ) . toBe ( 'GET' ) ;
185+ expect ( testUrl ) . toBe ( url + '/maritimepcinfo' ) ;
186+ expect ( options ) . not . toBeNull ( ) ;
187+ return Promise . resolve ( new Response ( JSON . stringify ( maritimepcinfo ) ) ) ;
188+ } ) ;
189+ service . getChartMaritimePcInfo ( ( result ) => {
190+ serviceResult = result ;
191+ try {
192+ expect ( service ) . not . toBeNull ( ) ;
193+ expect ( serviceResult ) . not . toBeNull ( ) ;
194+ expect ( serviceResult . type ) . toEqual ( 'processCompleted' ) ;
195+ var result = serviceResult . result ;
196+ expect ( result ) . not . toBeNull ( ) ;
197+ done ( ) ;
198+ } catch ( e ) {
199+ console . log ( "'getChartMaritimePcInfo'案例失败" + e . name + ':' + e . message ) ;
200+ expect ( false ) . toBeTruthy ( ) ;
201+ done ( ) ;
202+ }
203+ } ) ;
204+ } ) ;
181205 it ( '_processFormat' , ( done ) => {
182206 var service = new ChartService ( url , { } ) ;
183207 expect ( service . _processFormat ( ) ) . not . toBeFalsy ( ) ;
0 commit comments