@@ -25,7 +25,7 @@ describe('diffStatuses', () => {
2525 {
2626 externalId : 'part0' ,
2727 isReady : true ,
28- itemsReady : { } ,
28+ itemsReady : [ ] ,
2929 playbackStatus : IngestPartPlaybackStatus . UNKNOWN ,
3030 } ,
3131 ] ,
@@ -134,7 +134,7 @@ describe('diffStatuses', () => {
134134 extraPartState . segments [ 0 ] . parts . push ( {
135135 externalId : 'part1' ,
136136 isReady : false ,
137- itemsReady : { } ,
137+ itemsReady : [ ] ,
138138 playbackStatus : IngestPartPlaybackStatus . UNKNOWN ,
139139 } )
140140
@@ -155,7 +155,7 @@ describe('diffStatuses', () => {
155155 extraPartState . segments [ 0 ] . parts . push ( {
156156 externalId : 'part1' ,
157157 isReady : false ,
158- itemsReady : { } ,
158+ itemsReady : [ ] ,
159159 playbackStatus : IngestPartPlaybackStatus . UNKNOWN ,
160160 } )
161161
@@ -235,7 +235,7 @@ describe('diffStatuses', () => {
235235 test ( 'add items' , ( ) => {
236236 {
237237 const itemsState = structuredClone ( singlePartRundown )
238- itemsState . segments [ 0 ] . parts [ 0 ] . itemsReady . item0 = true
238+ itemsState . segments [ 0 ] . parts [ 0 ] . itemsReady . push ( { externalId : ' item0' , ready : true } )
239239
240240 const diff = diffStatuses ( defaultConfig , singlePartRundown , itemsState )
241241 expect ( diff ) . toHaveLength ( 1 )
@@ -250,7 +250,7 @@ describe('diffStatuses', () => {
250250
251251 {
252252 const itemsState = structuredClone ( singlePartRundown )
253- itemsState . segments [ 0 ] . parts [ 0 ] . itemsReady . item0 = false
253+ itemsState . segments [ 0 ] . parts [ 0 ] . itemsReady . push ( { externalId : ' item0' , ready : false } )
254254
255255 const diff = diffStatuses ( defaultConfig , singlePartRundown , itemsState )
256256 expect ( diff ) . toHaveLength ( 1 )
@@ -265,7 +265,7 @@ describe('diffStatuses', () => {
265265
266266 {
267267 const itemsState = structuredClone ( singlePartRundown )
268- itemsState . segments [ 0 ] . parts [ 0 ] . itemsReady . item0 = undefined
268+ // itemsState.segments[0].parts[0].itemsReady.item0 = undefined
269269
270270 const diff = diffStatuses ( defaultConfig , singlePartRundown , itemsState )
271271 expect ( diff ) . toHaveLength ( 0 )
@@ -275,7 +275,7 @@ describe('diffStatuses', () => {
275275 test ( 'remove items' , ( ) => {
276276 {
277277 const itemsState = structuredClone ( singlePartRundown )
278- itemsState . segments [ 0 ] . parts [ 0 ] . itemsReady . item0 = true
278+ itemsState . segments [ 0 ] . parts [ 0 ] . itemsReady . push ( { externalId : ' item0' , ready : true } )
279279
280280 const diff = diffStatuses ( defaultConfig , itemsState , singlePartRundown )
281281 expect ( diff ) . toHaveLength ( 1 )
@@ -290,7 +290,7 @@ describe('diffStatuses', () => {
290290
291291 {
292292 const itemsState = structuredClone ( singlePartRundown )
293- itemsState . segments [ 0 ] . parts [ 0 ] . itemsReady . item0 = undefined
293+ // itemsState.segments[0].parts[0].itemsReady.item0 = undefined
294294
295295 const diff = diffStatuses ( defaultConfig , itemsState , singlePartRundown )
296296 expect ( diff ) . toHaveLength ( 0 )
@@ -299,10 +299,10 @@ describe('diffStatuses', () => {
299299
300300 test ( 'change item state' , ( ) => {
301301 const itemsState = structuredClone ( singlePartRundown )
302- itemsState . segments [ 0 ] . parts [ 0 ] . itemsReady . item0 = true
302+ itemsState . segments [ 0 ] . parts [ 0 ] . itemsReady . push ( { externalId : ' item0' , ready : true } )
303303
304304 const items2State = structuredClone ( itemsState )
305- items2State . segments [ 0 ] . parts [ 0 ] . itemsReady . item0 = false
305+ items2State . segments [ 0 ] . parts [ 0 ] . itemsReady [ 0 ] . ready = false
306306
307307 const diff = diffStatuses ( defaultConfig , itemsState , items2State )
308308 expect ( diff ) . toHaveLength ( 1 )
0 commit comments