Skip to content

Commit

Permalink
chore: fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Jan 20, 2025
1 parent 3286d49 commit 6f934c2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/mos-gateway/src/mosStatus/__tests__/diff.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('diffStatuses', () => {
{
externalId: 'part0',
isReady: true,
itemsReady: {},
itemsReady: [],
playbackStatus: IngestPartPlaybackStatus.UNKNOWN,
},
],
Expand Down Expand Up @@ -134,7 +134,7 @@ describe('diffStatuses', () => {
extraPartState.segments[0].parts.push({
externalId: 'part1',
isReady: false,
itemsReady: {},
itemsReady: [],
playbackStatus: IngestPartPlaybackStatus.UNKNOWN,
})

Expand All @@ -155,7 +155,7 @@ describe('diffStatuses', () => {
extraPartState.segments[0].parts.push({
externalId: 'part1',
isReady: false,
itemsReady: {},
itemsReady: [],
playbackStatus: IngestPartPlaybackStatus.UNKNOWN,
})

Expand Down Expand Up @@ -235,7 +235,7 @@ describe('diffStatuses', () => {
test('add items', () => {
{
const itemsState = structuredClone(singlePartRundown)
itemsState.segments[0].parts[0].itemsReady.item0 = true
itemsState.segments[0].parts[0].itemsReady.push({ externalId: 'item0', ready: true })

const diff = diffStatuses(defaultConfig, singlePartRundown, itemsState)
expect(diff).toHaveLength(1)
Expand All @@ -250,7 +250,7 @@ describe('diffStatuses', () => {

{
const itemsState = structuredClone(singlePartRundown)
itemsState.segments[0].parts[0].itemsReady.item0 = false
itemsState.segments[0].parts[0].itemsReady.push({ externalId: 'item0', ready: false })

const diff = diffStatuses(defaultConfig, singlePartRundown, itemsState)
expect(diff).toHaveLength(1)
Expand All @@ -265,7 +265,7 @@ describe('diffStatuses', () => {

{
const itemsState = structuredClone(singlePartRundown)
itemsState.segments[0].parts[0].itemsReady.item0 = undefined
// itemsState.segments[0].parts[0].itemsReady.item0 = undefined

const diff = diffStatuses(defaultConfig, singlePartRundown, itemsState)
expect(diff).toHaveLength(0)
Expand All @@ -275,7 +275,7 @@ describe('diffStatuses', () => {
test('remove items', () => {
{
const itemsState = structuredClone(singlePartRundown)
itemsState.segments[0].parts[0].itemsReady.item0 = true
itemsState.segments[0].parts[0].itemsReady.push({ externalId: 'item0', ready: true })

const diff = diffStatuses(defaultConfig, itemsState, singlePartRundown)
expect(diff).toHaveLength(1)
Expand All @@ -290,7 +290,7 @@ describe('diffStatuses', () => {

{
const itemsState = structuredClone(singlePartRundown)
itemsState.segments[0].parts[0].itemsReady.item0 = undefined
// itemsState.segments[0].parts[0].itemsReady.item0 = undefined

const diff = diffStatuses(defaultConfig, itemsState, singlePartRundown)
expect(diff).toHaveLength(0)
Expand All @@ -299,10 +299,10 @@ describe('diffStatuses', () => {

test('change item state', () => {
const itemsState = structuredClone(singlePartRundown)
itemsState.segments[0].parts[0].itemsReady.item0 = true
itemsState.segments[0].parts[0].itemsReady.push({ externalId: 'item0', ready: true })

const items2State = structuredClone(itemsState)
items2State.segments[0].parts[0].itemsReady.item0 = false
items2State.segments[0].parts[0].itemsReady[0].ready = false

const diff = diffStatuses(defaultConfig, itemsState, items2State)
expect(diff).toHaveLength(1)
Expand Down

0 comments on commit 6f934c2

Please sign in to comment.