@@ -21,8 +21,8 @@ function createHistoryItem(promptId: string, queueIndex = 0): TaskItem {
2121 }
2222}
2323
24- function getAllPromptIds ( result : { items : TaskItem [ ] } ) : string [ ] {
25- return result . items . map ( ( item ) => item . prompt [ 1 ] )
24+ function getAllPromptIds ( result : TaskItem [ ] ) : string [ ] {
25+ return result . map ( ( item ) => item . prompt [ 1 ] )
2626}
2727
2828describe ( 'reconcileHistory (V1)' , ( ) => {
@@ -74,9 +74,9 @@ describe('reconcileHistory (V1)', () => {
7474
7575 const result = reconcileHistory ( serverHistory , [ ] , 10 , undefined )
7676
77- expect ( result . items ) . toHaveLength ( 2 )
78- expect ( result . items [ 0 ] . prompt [ 1 ] ) . toBe ( 'item-1' )
79- expect ( result . items [ 1 ] . prompt [ 1 ] ) . toBe ( 'item-2' )
77+ expect ( result ) . toHaveLength ( 2 )
78+ expect ( result [ 0 ] . prompt [ 1 ] ) . toBe ( 'item-1' )
79+ expect ( result [ 1 ] . prompt [ 1 ] ) . toBe ( 'item-2' )
8080 } )
8181 } )
8282
@@ -144,9 +144,9 @@ describe('reconcileHistory (V1)', () => {
144144
145145 const result = reconcileHistory ( serverHistory , clientHistory , 2 , 10 )
146146
147- expect ( result . items ) . toHaveLength ( 2 )
148- expect ( result . items [ 0 ] . prompt [ 1 ] ) . toBe ( 'new-1' )
149- expect ( result . items [ 1 ] . prompt [ 1 ] ) . toBe ( 'new-2' )
147+ expect ( result ) . toHaveLength ( 2 )
148+ expect ( result [ 0 ] . prompt [ 1 ] ) . toBe ( 'new-1' )
149+ expect ( result [ 1 ] . prompt [ 1 ] ) . toBe ( 'new-2' )
150150 } )
151151 } )
152152
@@ -168,13 +168,13 @@ describe('reconcileHistory (V1)', () => {
168168
169169 const result = reconcileHistory ( [ ] , clientHistory , 10 , 5 )
170170
171- expect ( result . items ) . toHaveLength ( 0 )
171+ expect ( result ) . toHaveLength ( 0 )
172172 } )
173173
174174 it ( 'should return empty result when both collections are empty' , ( ) => {
175175 const result = reconcileHistory ( [ ] , [ ] , 10 , undefined )
176176
177- expect ( result . items ) . toHaveLength ( 0 )
177+ expect ( result ) . toHaveLength ( 0 )
178178 } )
179179 } )
180180} )
@@ -295,9 +295,9 @@ describe('reconcileHistory (V2/Cloud)', () => {
295295
296296 const result = reconcileHistory ( serverHistory , clientHistory , 2 )
297297
298- expect ( result . items ) . toHaveLength ( 2 )
299- expect ( result . items [ 0 ] . prompt [ 1 ] ) . toBe ( 'new-1' )
300- expect ( result . items [ 1 ] . prompt [ 1 ] ) . toBe ( 'new-2' )
298+ expect ( result ) . toHaveLength ( 2 )
299+ expect ( result [ 0 ] . prompt [ 1 ] ) . toBe ( 'new-1' )
300+ expect ( result [ 1 ] . prompt [ 1 ] ) . toBe ( 'new-2' )
301301 } )
302302 } )
303303
@@ -310,9 +310,9 @@ describe('reconcileHistory (V2/Cloud)', () => {
310310
311311 const result = reconcileHistory ( serverHistory , [ ] , 10 )
312312
313- expect ( result . items ) . toHaveLength ( 2 )
314- expect ( result . items [ 0 ] . prompt [ 1 ] ) . toBe ( 'item-1' )
315- expect ( result . items [ 1 ] . prompt [ 1 ] ) . toBe ( 'item-2' )
313+ expect ( result ) . toHaveLength ( 2 )
314+ expect ( result [ 0 ] . prompt [ 1 ] ) . toBe ( 'item-1' )
315+ expect ( result [ 1 ] . prompt [ 1 ] ) . toBe ( 'item-2' )
316316 } )
317317
318318 it ( 'should return empty result when server history is empty' , ( ) => {
@@ -323,13 +323,13 @@ describe('reconcileHistory (V2/Cloud)', () => {
323323
324324 const result = reconcileHistory ( [ ] , clientHistory , 10 )
325325
326- expect ( result . items ) . toHaveLength ( 0 )
326+ expect ( result ) . toHaveLength ( 0 )
327327 } )
328328
329329 it ( 'should return empty result when both collections are empty' , ( ) => {
330330 const result = reconcileHistory ( [ ] , [ ] , 10 )
331331
332- expect ( result . items ) . toHaveLength ( 0 )
332+ expect ( result ) . toHaveLength ( 0 )
333333 } )
334334 } )
335335} )
0 commit comments