11// NOTE: this is auto-mocked in __mocks__
2- import { queryFeatures } from '@esri/arcgis-rest-feature-service'
2+ import { queryFeatures , decodeValues } from '@esri/arcgis-rest-feature-service'
33import { } from 'jest'
44import config from '../../src/config'
55import { queryDatasets } from '../../src/query/query'
@@ -10,6 +10,9 @@ import * as definitions from '../data/definitions'
1010// TODO: how to tell TS that type of queryFeatures is a jest mock function???
1111const mockQueryFeatures = ( queryFeatures as any )
1212
13+ const mockDecodeValues = ( decodeValues as any )
14+
15+
1316// TODO: ues actual requestOptions type
1417const verifyRequestOptions = ( dataset , requestOptions : any , expectedFetch = undefined ) => {
1518 expect ( requestOptions . url ) . toEqual ( dataset . url )
@@ -33,6 +36,7 @@ describe('when querying datasets', () => {
3336 describe ( 'when a single dataset' , ( ) => {
3437 beforeEach ( ( ) => {
3538 mockQueryFeatures . mockClear ( )
39+ mockDecodeValues . mockClear ( )
3640 } )
3741 describe ( 'when that dataset has a name' , ( ) => {
3842 const datasets = definitions . bar . datasets
@@ -88,6 +92,7 @@ describe('when querying datasets', () => {
8892 describe ( 'when multiple datasets' , ( ) => {
8993 beforeEach ( ( ) => {
9094 mockQueryFeatures . mockClear ( )
95+ mockDecodeValues . mockClear ( )
9196 } )
9297 describe ( 'when one has inline data' , ( ) => {
9398 const barDataset = definitions . bar . datasets [ 0 ]
0 commit comments