@@ -25,7 +25,7 @@ describe('diffStatuses', () => {
25
25
{
26
26
externalId : 'part0' ,
27
27
isReady : true ,
28
- itemsReady : { } ,
28
+ itemsReady : [ ] ,
29
29
playbackStatus : IngestPartPlaybackStatus . UNKNOWN ,
30
30
} ,
31
31
] ,
@@ -134,7 +134,7 @@ describe('diffStatuses', () => {
134
134
extraPartState . segments [ 0 ] . parts . push ( {
135
135
externalId : 'part1' ,
136
136
isReady : false ,
137
- itemsReady : { } ,
137
+ itemsReady : [ ] ,
138
138
playbackStatus : IngestPartPlaybackStatus . UNKNOWN ,
139
139
} )
140
140
@@ -155,7 +155,7 @@ describe('diffStatuses', () => {
155
155
extraPartState . segments [ 0 ] . parts . push ( {
156
156
externalId : 'part1' ,
157
157
isReady : false ,
158
- itemsReady : { } ,
158
+ itemsReady : [ ] ,
159
159
playbackStatus : IngestPartPlaybackStatus . UNKNOWN ,
160
160
} )
161
161
@@ -235,7 +235,7 @@ describe('diffStatuses', () => {
235
235
test ( 'add items' , ( ) => {
236
236
{
237
237
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 } )
239
239
240
240
const diff = diffStatuses ( defaultConfig , singlePartRundown , itemsState )
241
241
expect ( diff ) . toHaveLength ( 1 )
@@ -250,7 +250,7 @@ describe('diffStatuses', () => {
250
250
251
251
{
252
252
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 } )
254
254
255
255
const diff = diffStatuses ( defaultConfig , singlePartRundown , itemsState )
256
256
expect ( diff ) . toHaveLength ( 1 )
@@ -265,7 +265,7 @@ describe('diffStatuses', () => {
265
265
266
266
{
267
267
const itemsState = structuredClone ( singlePartRundown )
268
- itemsState . segments [ 0 ] . parts [ 0 ] . itemsReady . item0 = undefined
268
+ // itemsState.segments[0].parts[0].itemsReady.item0 = undefined
269
269
270
270
const diff = diffStatuses ( defaultConfig , singlePartRundown , itemsState )
271
271
expect ( diff ) . toHaveLength ( 0 )
@@ -275,7 +275,7 @@ describe('diffStatuses', () => {
275
275
test ( 'remove items' , ( ) => {
276
276
{
277
277
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 } )
279
279
280
280
const diff = diffStatuses ( defaultConfig , itemsState , singlePartRundown )
281
281
expect ( diff ) . toHaveLength ( 1 )
@@ -290,7 +290,7 @@ describe('diffStatuses', () => {
290
290
291
291
{
292
292
const itemsState = structuredClone ( singlePartRundown )
293
- itemsState . segments [ 0 ] . parts [ 0 ] . itemsReady . item0 = undefined
293
+ // itemsState.segments[0].parts[0].itemsReady.item0 = undefined
294
294
295
295
const diff = diffStatuses ( defaultConfig , itemsState , singlePartRundown )
296
296
expect ( diff ) . toHaveLength ( 0 )
@@ -299,10 +299,10 @@ describe('diffStatuses', () => {
299
299
300
300
test ( 'change item state' , ( ) => {
301
301
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 } )
303
303
304
304
const items2State = structuredClone ( itemsState )
305
- items2State . segments [ 0 ] . parts [ 0 ] . itemsReady . item0 = false
305
+ items2State . segments [ 0 ] . parts [ 0 ] . itemsReady [ 0 ] . ready = false
306
306
307
307
const diff = diffStatuses ( defaultConfig , itemsState , items2State )
308
308
expect ( diff ) . toHaveLength ( 1 )
0 commit comments