@@ -126,7 +126,7 @@ describe('HttpTspClient Deserialization', () => {
126126 httpRequestMock . mockReturnValueOnce ( fixtures . asResponse ( 'experiment-outputs-0.json' ) ) ;
127127 const response = await client . experimentOutputs ( 'not-relevant' ) ;
128128 const outputs = response . getModel ( ) ! ;
129- expect ( outputs ) . toHaveLength ( 6 ) ;
129+ expect ( outputs ) . toHaveLength ( 7 ) ;
130130
131131 let output = outputs . find ( ( item ) => item . id === 'timegraph.output.id1' ) ;
132132 expect ( output ) . toBeDefined ( ) ;
@@ -141,6 +141,11 @@ describe('HttpTspClient Deserialization', () => {
141141 expect ( output ?. capabilities ?. canCreate ) . toBeFalsy ( ) ;
142142 expect ( output ?. capabilities ?. canDelete ) . toBeTruthy ( ) ;
143143 expect ( output ?. configuration ) . toBeDefined ( ) ;
144+
145+ output = outputs . find ( ( item ) => item . id === 'data.output.id' ) ;
146+ expect ( output ) . toBeDefined ( ) ;
147+ expect ( output ?. capabilities ) . toBeDefined ( ) ;
148+ expect ( output ?. capabilities ?. selectionRange ) . toBeTruthy ( ) ;
144149 } ) ;
145150
146151 it ( 'fetchAnnotationsCategories' , async ( ) => {
@@ -210,6 +215,27 @@ describe('HttpTspClient Deserialization', () => {
210215 expect ( identifier . productId ) . toBeDefined ( ) ;
211216 } ) ;
212217
218+ it ( 'fetchObject' , async ( ) => {
219+ httpRequestMock . mockReturnValueOnce ( fixtures . asResponse ( 'fetch-object-0.json' ) ) ;
220+ const response = await client . fetchObject ( 'not-relevant' , 'not-relevant' , new Query ( { } ) ) ;
221+ const genericResponse = response . getModel ( ) ! ;
222+ const object = genericResponse . model . object ;
223+ const next = genericResponse . model . next ;
224+ const previous = genericResponse . model . previous ;
225+
226+ expect ( object ) . toBeDefined ( ) ;
227+ expect ( object [ 'fooNumber' ] ) . toEqual ( BigInt ( '1234567890123456789' ) ) ;
228+ expect ( object [ 'fooString' ] ) . toEqual ( 'foo' ) ;
229+ expect ( object [ 'fooObj' ] [ 'fooA' ] ) . toEqual ( { "A1key" : "A1val" , "A2key" : 1 } ) ;
230+ expect ( object [ 'fooObj' ] [ 'fooB' ] ) . toEqual ( { "B1key" : "B1val" , "B2key" : 2 } ) ;
231+ expect ( object [ 'fooNumArray' ] ) . toEqual ( [ 1 , 2 , 3 ] ) ;
232+ expect ( object [ 'fooObjArray' ] ) . toEqual ( [ { "k" : "v1" } , { "k" : "v2" } , { "k" : "v3" } ] ) ;
233+ expect ( next ) . toBeDefined ( ) ;
234+ expect ( next ) . toEqual ( BigInt ( '9876543210987654321' ) ) ;
235+ expect ( previous ) . toBeDefined ( ) ;
236+ expect ( previous ) . toEqual ( { "rank" : 0 } ) ;
237+ } ) ;
238+
213239 it ( 'fetchMarkerSets' , async ( ) => {
214240 httpRequestMock . mockReturnValueOnce ( fixtures . asResponse ( 'fetch-marker-sets-0.json' ) ) ;
215241 const response = await client . fetchMarkerSets ( 'not-relevant' ) ;
0 commit comments