diff --git a/meteor/server/publications/blueprintUpgradeStatus/__tests__/generateNotesForSegment.test.ts2 b/meteor/server/publications/blueprintUpgradeStatus/__tests__/generateNotesForSegment.test.ts2 deleted file mode 100644 index 3aad53787b..0000000000 --- a/meteor/server/publications/blueprintUpgradeStatus/__tests__/generateNotesForSegment.test.ts2 +++ /dev/null @@ -1,489 +0,0 @@ -import { NoteSeverity } from '@sofie-automation/blueprints-integration' -import { RundownPlaylistId } from '@sofie-automation/corelib/dist/dataModel/Ids' -import { PartNote, SegmentNote } from '@sofie-automation/corelib/dist/dataModel/Notes' -import { DBPart } from '@sofie-automation/corelib/dist/dataModel/Part' -import { DBPartInstance } from '@sofie-automation/corelib/dist/dataModel/PartInstance' -import { SegmentOrphanedReason } from '@sofie-automation/corelib/dist/dataModel/Segment' -import { clone, getRandomId, literal } from '@sofie-automation/corelib/dist/lib' -import { protectString } from '@sofie-automation/corelib/dist/protectedString' -import { UISegmentPartNote } from '../../../../lib/api/rundownNotifications' -import { DBSegment } from '@sofie-automation/corelib/dist/dataModel/Segment' -import { generateTranslation } from '../../../../lib/lib' -import { generateNotesForSegment } from '../generateNotesForSegment' -import { PartFields, PartInstanceFields, SegmentFields } from '../reactiveContentCache' - -describe('generateNotesForSegment', () => { - test('no notes', async () => { - const playlistId = protectString('playlist0') - const nrcsName = 'some nrcs' - const segment: Pick = { - _id: protectString('segment0'), - _rank: 1, - rundownId: protectString('rundown0'), - name: 'A segment', - notes: [], - orphaned: undefined, - } - - const notes = generateNotesForSegment(playlistId, segment, nrcsName, [], []) - expect(notes).toHaveLength(0) - }) - - test('orphaned: deleted segment', async () => { - const playlistId = protectString('playlist0') - const nrcsName = 'some nrcs' - const segment: Pick = { - _id: protectString('segment0'), - _rank: 1, - rundownId: protectString('rundown0'), - name: 'A segment', - notes: [], - orphaned: SegmentOrphanedReason.DELETED, - } - - const notes = generateNotesForSegment(playlistId, segment, nrcsName, [], []) - expect(notes).toEqual( - literal([ - { - _id: protectString('segment0_segment_orphaned'), - note: { - message: generateTranslation('Segment no longer exists in {{nrcs}}', { nrcs: nrcsName }), - origin: { - name: segment.name, - segmentId: segment._id, - rundownId: segment.rundownId, - }, - rank: segment._rank, - type: NoteSeverity.WARNING, - }, - playlistId: playlistId, - rundownId: segment.rundownId, - segmentId: segment._id, - }, - ]) - ) - }) - - test('orphaned: hidden segment', async () => { - const playlistId = protectString('playlist0') - const nrcsName = 'some nrcs' - const segment: Pick = { - _id: protectString('segment0'), - _rank: 1, - rundownId: protectString('rundown0'), - name: 'A segment', - notes: [], - orphaned: SegmentOrphanedReason.HIDDEN, - } - - const notes = generateNotesForSegment(playlistId, segment, nrcsName, [], []) - expect(notes).toEqual( - literal([ - { - _id: protectString('segment0_segment_orphaned'), - note: { - message: generateTranslation('Segment was hidden in {{nrcs}}', { nrcs: nrcsName }), - origin: { - name: segment.name, - segmentId: segment._id, - rundownId: segment.rundownId, - }, - rank: segment._rank, - type: NoteSeverity.WARNING, - }, - playlistId: playlistId, - rundownId: segment.rundownId, - segmentId: segment._id, - }, - ]) - ) - }) - - test('segment has notes', async () => { - const playlistId = protectString('playlist0') - const nrcsName = 'some nrcs' - - const note1 = literal({ - type: NoteSeverity.INFO, - message: generateTranslation('some message', { arg1: 'abc', arg2: 123 }), - origin: { - name: 'somewhere', - }, - }) - const note2 = literal({ - type: NoteSeverity.ERROR, - message: generateTranslation('a second', { arg1: 'abc', arg2: 123 }), - origin: { - name: 'elsewhere', - }, - }) - - const segment: Pick = { - _id: protectString('segment0'), - _rank: 1, - rundownId: protectString('rundown0'), - name: 'A segment', - notes: [ - // Clone to avoid mutation issues - clone(note1), - clone(note2), - ], - orphaned: undefined, - } - - const notes = generateNotesForSegment(playlistId, segment, nrcsName, [], []) - expect(notes).toEqual( - literal([ - { - _id: protectString('segment0_segment_0'), - note: { - ...note1, - origin: { - ...note1.origin, - segmentId: segment._id, - rundownId: segment.rundownId, - }, - rank: segment._rank, - }, - playlistId: playlistId, - rundownId: segment.rundownId, - segmentId: segment._id, - }, - { - _id: protectString('segment0_segment_1'), - note: { - ...note2, - origin: { - ...note2.origin, - segmentId: segment._id, - rundownId: segment.rundownId, - }, - rank: segment._rank, - }, - playlistId: playlistId, - rundownId: segment.rundownId, - segmentId: segment._id, - }, - ]) - ) - }) - - test('deleted partinstances', async () => { - const playlistId = protectString('playlist0') - const nrcsName = 'some nrcs' - - const segment: Pick = { - _id: protectString('segment0'), - _rank: 1, - rundownId: protectString('rundown0'), - name: 'A segment', - notes: [], - orphaned: undefined, - } - - const partInstances: Pick[] = [ - { - _id: getRandomId(), - segmentId: segment._id, - rundownId: segment.rundownId, - orphaned: 'deleted', - reset: false, - part: { - title: 'one', - } as any, - }, - { - _id: getRandomId(), - segmentId: segment._id, - rundownId: segment.rundownId, - orphaned: 'deleted', - reset: false, - part: { - title: 'two', - } as any, - }, - { - _id: getRandomId(), - segmentId: segment._id, - rundownId: segment.rundownId, - orphaned: undefined, - reset: false, - part: { - title: 'not orphaned', - } as any, - }, - { - _id: getRandomId(), - segmentId: segment._id, - rundownId: segment.rundownId, - orphaned: 'adlib-part', - reset: false, - part: { - title: 'wrong orphaned', - } as any, - }, - { - _id: getRandomId(), - segmentId: segment._id, - rundownId: segment.rundownId, - orphaned: 'deleted', - reset: true, - part: { - title: 'reset', - } as any, - }, - ] - - const notes = generateNotesForSegment(playlistId, segment, nrcsName, [], partInstances) - expect(notes).toEqual( - literal([ - { - _id: protectString('segment0_partinstances_deleted'), - note: { - type: NoteSeverity.WARNING, - message: generateTranslation('The following parts no longer exist in {{nrcs}}: {{partNames}}', { - nrcs: nrcsName, - partNames: ['one', 'two'].join(', '), - }), - rank: segment._rank, - origin: { - segmentId: segment._id, - rundownId: segment.rundownId, - name: segment.name, - }, - }, - playlistId: playlistId, - rundownId: segment.rundownId, - segmentId: segment._id, - }, - ]) - ) - }) - - test('deleted partinstances with orphaned segment', async () => { - const playlistId = protectString('playlist0') - const nrcsName = 'some nrcs' - - const segment: Pick = { - _id: protectString('segment0'), - _rank: 1, - rundownId: protectString('rundown0'), - name: 'A segment', - notes: [], - orphaned: SegmentOrphanedReason.DELETED, - } - - const partInstances: Pick[] = [ - { - _id: getRandomId(), - segmentId: segment._id, - rundownId: segment.rundownId, - orphaned: 'deleted', - reset: false, - part: { - title: 'one', - } as any, - }, - ] - - const notes = generateNotesForSegment(playlistId, segment, nrcsName, [], partInstances) - expect(notes).toHaveLength(1) - expect(notes[0]._id).toBe('segment0_segment_orphaned') - }) - - test('good part has no notes', async () => { - const playlistId = protectString('playlist0') - const nrcsName = 'some nrcs' - - const segment: Pick = { - _id: protectString('segment0'), - _rank: 1, - rundownId: protectString('rundown0'), - name: 'A segment', - notes: [], - orphaned: undefined, - } - - const parts: Pick[] = [ - { - _id: getRandomId(), - _rank: 6, - segmentId: segment._id, - rundownId: segment.rundownId, - notes: [], - title: 'one', - invalid: false, - invalidReason: undefined, - }, - ] - - const notes = generateNotesForSegment(playlistId, segment, nrcsName, parts, []) - expect(notes).toHaveLength(0) - }) - - test('part is invalid, with no reason', async () => { - const playlistId = protectString('playlist0') - const nrcsName = 'some nrcs' - - const segment: Pick = { - _id: protectString('segment0'), - _rank: 1, - rundownId: protectString('rundown0'), - name: 'A segment', - notes: [], - orphaned: undefined, - } - - const parts: Pick[] = [ - { - _id: getRandomId(), - _rank: 6, - segmentId: segment._id, - rundownId: segment.rundownId, - notes: [], - title: 'one', - invalid: true, - invalidReason: undefined, - }, - ] - - const notes = generateNotesForSegment(playlistId, segment, nrcsName, parts, []) - expect(notes).toHaveLength(0) - }) - - test('part is invalid, with a reason', async () => { - const playlistId = protectString('playlist0') - const nrcsName = 'some nrcs' - - const segment: Pick = { - _id: protectString('segment0'), - _rank: 1, - rundownId: protectString('rundown0'), - name: 'A segment', - notes: [], - orphaned: undefined, - } - - const part0: Pick = { - _id: protectString('part0'), - _rank: 6, - segmentId: segment._id, - rundownId: segment.rundownId, - notes: [], - title: 'one', - invalid: true, - invalidReason: { - message: generateTranslation('some reason'), - severity: NoteSeverity.INFO, - }, - } - - const notes = generateNotesForSegment(playlistId, segment, nrcsName, [part0], []) - expect(notes).toEqual( - literal([ - { - _id: protectString('segment0_part_part0_invalid'), - note: { - type: NoteSeverity.INFO, - message: generateTranslation('some reason'), - rank: segment._rank, - origin: { - segmentId: segment._id, - rundownId: segment.rundownId, - name: part0.title, - partId: part0._id, - segmentName: segment.name, - }, - }, - playlistId: playlistId, - rundownId: segment.rundownId, - segmentId: segment._id, - }, - ]) - ) - }) - - test('part has notes', async () => { - const playlistId = protectString('playlist0') - const nrcsName = 'some nrcs' - - const segment: Pick = { - _id: protectString('segment0'), - _rank: 1, - rundownId: protectString('rundown0'), - name: 'A segment', - notes: [], - orphaned: undefined, - } - - const note1 = literal({ - type: NoteSeverity.INFO, - message: generateTranslation('some message', { arg1: 'abc', arg2: 123 }), - origin: { - name: 'somewhere', - }, - }) - const note2 = literal({ - type: NoteSeverity.ERROR, - message: generateTranslation('a second', { arg1: 'abc', arg2: 123 }), - origin: { - name: 'elsewhere', - }, - }) - - const part0: Pick = { - _id: protectString('part0'), - _rank: 6, - segmentId: segment._id, - rundownId: segment.rundownId, - notes: [ - // Clone to avoid mutation issues - clone(note1), - clone(note2), - ], - title: 'one', - invalid: false, - invalidReason: undefined, - } - - const notes = generateNotesForSegment(playlistId, segment, nrcsName, [part0], []) - expect(notes).toEqual( - literal([ - { - _id: protectString('segment0_part_part0_0'), - note: { - ...note1, - rank: segment._rank, - origin: { - ...note1.origin, - segmentId: segment._id, - rundownId: segment.rundownId, - partId: part0._id, - segmentName: segment.name, - }, - }, - playlistId: playlistId, - rundownId: segment.rundownId, - segmentId: segment._id, - }, - { - _id: protectString('segment0_part_part0_1'), - note: { - ...note2, - rank: segment._rank, - origin: { - ...note2.origin, - segmentId: segment._id, - rundownId: segment.rundownId, - partId: part0._id, - segmentName: segment.name, - }, - }, - playlistId: playlistId, - rundownId: segment.rundownId, - segmentId: segment._id, - }, - ]) - ) - }) -}) diff --git a/meteor/server/publications/blueprintUpgradeStatus/__tests__/publication.test.ts2 b/meteor/server/publications/blueprintUpgradeStatus/__tests__/publication.test.ts2 deleted file mode 100644 index 9559f21e11..0000000000 --- a/meteor/server/publications/blueprintUpgradeStatus/__tests__/publication.test.ts2 +++ /dev/null @@ -1,454 +0,0 @@ -import { RundownId, RundownPlaylistId, SegmentId } from '@sofie-automation/corelib/dist/dataModel/Ids' -import { ProtectedString, protectString } from '@sofie-automation/corelib/dist/protectedString' -import { UISegmentPartNote } from '../../../../lib/api/rundownNotifications' -import { testInFiber } from '../../../../__mocks__/helpers/jest' -import { CustomPublishCollection } from '../../../lib/customPublication' -import { ReactiveCacheCollection } from '../../lib/ReactiveCacheCollection' -import { manipulateUISegmentPartNotesPublicationData, UISegmentPartNotesState } from '../publication' -import { ContentCache } from '../reactiveContentCache' -import * as generateNotesForSegment from '../generateNotesForSegment' -import { literal } from '@sofie-automation/corelib/dist/lib' - -jest.spyOn(generateNotesForSegment, 'generateNotesForSegment').mockImplementation((playlistId, segment) => { - return literal([ - { - _id: protectString(`note-${segment._id}`), - playlistId: playlistId, - rundownId: segment.rundownId, - segmentId: segment._id, - - note: 'fake note' as any, - }, - ]) -}) - -class CustomPublishCollectionExt }> extends CustomPublishCollection { - // getAllCalls(): Array{ - // } - - clearAllMocks(): void { - // Implemented below - } -} - -function createSpyPublishCollection(): CustomPublishCollectionExt { - const collection = new CustomPublishCollectionExt('UISegmentPartNote') - - const findAllSpy = jest.spyOn(collection, 'findAll') - const findOneSpy = jest.spyOn(collection, 'findOne') - const insertSpy = jest.spyOn(collection, 'insert') - const removeSpy = jest.spyOn(collection, 'remove') - const updateOneSpy = jest.spyOn(collection, 'updateOne') - const updateAllSpy = jest.spyOn(collection, 'updateAll') - const replaceSpy = jest.spyOn(collection, 'replace') - - collection.clearAllMocks = () => { - findAllSpy.mockClear() - findOneSpy.mockClear() - insertSpy.mockClear() - removeSpy.mockClear() - updateOneSpy.mockClear() - updateAllSpy.mockClear() - replaceSpy.mockClear() - } - - return collection -} - -describe('manipulateUISegmentPartNotesPublicationData', () => { - beforeEach(() => { - jest.clearAllMocks() - }) - - const playlistId = protectString('playlist0') - const rundownId = protectString('rundown0') - const segmentId0 = protectString('segment0') - const segmentId1 = protectString('segment1') - - function createAndPopulateMockCache(): ContentCache { - const newCache: ContentCache = { - Rundowns: new ReactiveCacheCollection('Rundowns'), - Segments: new ReactiveCacheCollection('Segments'), - Parts: new ReactiveCacheCollection('Parts'), - DeletedPartInstances: new ReactiveCacheCollection('DeletedPartInstances'), - } - - newCache.Rundowns.insert({ - _id: rundownId, - playlistId: playlistId, - externalNRCSName: 'NRCS+ 2000', - }) - - newCache.Segments.insert({ - _id: segmentId0, - _rank: 1, - rundownId: rundownId, - name: 'Segment 0', - notes: [], - orphaned: undefined, - }) - newCache.Segments.insert({ - _id: segmentId1, - _rank: 1, - rundownId: rundownId, - name: 'Segment 1', - notes: [], - orphaned: undefined, - }) - - return newCache - } - - const defaultNotes = [ - { - _id: 'note-segment0', - note: 'fake note', - playlistId: 'playlist0', - rundownId: 'rundown0', - segmentId: 'segment0', - }, - { - _id: 'note-segment1', - note: 'fake note', - playlistId: 'playlist0', - rundownId: 'rundown0', - segmentId: 'segment1', - }, - ] - - testInFiber('basic call', async () => { - const state: Partial = {} - const collection = createSpyPublishCollection() - - await manipulateUISegmentPartNotesPublicationData( - { - playlistId, - }, - state, - collection, - undefined - ) - - // Nothing should have changed - expect(collection.commitChanges()).toEqual([[], { added: [], changed: [], removed: [] }]) - expect(generateNotesForSegment.generateNotesForSegment).toHaveBeenCalledTimes(0) - - // check that everything was removed - expect(collection.remove).toHaveBeenCalledTimes(1) - expect(collection.remove).toHaveBeenLastCalledWith(null) - }) - - testInFiber('first cache', async () => { - const playlistId = protectString('playlist0') - const state: Partial = {} - const collection = createSpyPublishCollection() - const newCache = createAndPopulateMockCache() - - await manipulateUISegmentPartNotesPublicationData( - { - playlistId, - }, - state, - collection, - { newCache } - ) - - // Some notes should have been added - expect(collection.commitChanges()).toEqual([defaultNotes, { added: defaultNotes, changed: [], removed: [] }]) - expect(generateNotesForSegment.generateNotesForSegment).toHaveBeenCalledTimes(2) - - // check that everything was removed and replaced - expect(collection.remove).toHaveBeenCalledTimes(1) - expect(collection.remove).toHaveBeenLastCalledWith(null) - expect(collection.replace).toHaveBeenCalledTimes(2) - }) - - testInFiber('replace cache', async () => { - const playlistId = protectString('playlist0') - const state: Partial = {} - const collection = createSpyPublishCollection() - const newCache = createAndPopulateMockCache() - - // start out normally - await manipulateUISegmentPartNotesPublicationData( - { - playlistId, - }, - state, - collection, - { newCache } - ) - - // Some notes should have been added - expect(collection.commitChanges()).toEqual([defaultNotes, { added: defaultNotes, changed: [], removed: [] }]) - expect(generateNotesForSegment.generateNotesForSegment).toHaveBeenCalledTimes(2) - collection.clearAllMocks() - - const newCache2 = createAndPopulateMockCache() - newCache2.Segments.remove(segmentId0) - - // replace the cache - await manipulateUISegmentPartNotesPublicationData( - { - playlistId, - }, - state, - collection, - { newCache: newCache2 } - ) - - // check that everything was removed and replaced - expect(collection.remove).toHaveBeenCalledTimes(1) - expect(collection.remove).toHaveBeenLastCalledWith(null) - expect(collection.replace).toHaveBeenCalledTimes(1) - expect(collection.commitChanges()).toEqual([ - [defaultNotes[1]], - { added: [], changed: [], removed: [defaultNotes[0]._id] }, - ]) - expect(generateNotesForSegment.generateNotesForSegment).toHaveBeenCalledTimes(3) - }) - - testInFiber('update no reported changes', async () => { - const playlistId = protectString('playlist0') - const state: Partial = {} - const collection = createSpyPublishCollection() - const newCache = createAndPopulateMockCache() - - // start out normally - await manipulateUISegmentPartNotesPublicationData( - { - playlistId, - }, - state, - collection, - { newCache } - ) - - // Some notes should have been added - expect(collection.commitChanges()).toEqual([defaultNotes, { added: defaultNotes, changed: [], removed: [] }]) - expect(generateNotesForSegment.generateNotesForSegment).toHaveBeenCalledTimes(2) - collection.clearAllMocks() - - // no change - await manipulateUISegmentPartNotesPublicationData( - { - playlistId, - }, - state, - collection, - { invalidateRundownIds: [], invalidateSegmentIds: [] } - ) - - // check that nothing was done - expect(collection.remove).toHaveBeenCalledTimes(0) - expect(collection.replace).toHaveBeenCalledTimes(0) - expect(generateNotesForSegment.generateNotesForSegment).toHaveBeenCalledTimes(2) - }) - - testInFiber('rundown changed', async () => { - const playlistId = protectString('playlist0') - const state: Partial = {} - const collection = createSpyPublishCollection() - const newCache = createAndPopulateMockCache() - - // start out normally - await manipulateUISegmentPartNotesPublicationData( - { - playlistId, - }, - state, - collection, - { newCache } - ) - - // Some notes should have been added - expect(collection.commitChanges()).toEqual([defaultNotes, { added: defaultNotes, changed: [], removed: [] }]) - expect(generateNotesForSegment.generateNotesForSegment).toHaveBeenCalledTimes(2) - collection.clearAllMocks() - - // invalidate a rundown - await manipulateUISegmentPartNotesPublicationData( - { - playlistId, - }, - state, - collection, - { invalidateRundownIds: [rundownId] } - ) - - // check that nothing was done - expect(collection.remove).toHaveBeenCalledTimes(1) - expect(collection.remove).toHaveBeenLastCalledWith(expect.anything()) - expect(collection.replace).toHaveBeenCalledTimes(2) - expect(generateNotesForSegment.generateNotesForSegment).toHaveBeenCalledTimes(4) - }) - - testInFiber('segment changed', async () => { - const playlistId = protectString('playlist0') - const state: Partial = {} - const collection = createSpyPublishCollection() - const newCache = createAndPopulateMockCache() - - // start out normally - await manipulateUISegmentPartNotesPublicationData( - { - playlistId, - }, - state, - collection, - { newCache } - ) - - // Some notes should have been added - expect(collection.commitChanges()).toEqual([defaultNotes, { added: defaultNotes, changed: [], removed: [] }]) - expect(generateNotesForSegment.generateNotesForSegment).toHaveBeenCalledTimes(2) - collection.clearAllMocks() - - // invalidate a rundown - await manipulateUISegmentPartNotesPublicationData( - { - playlistId, - }, - state, - collection, - { invalidateSegmentIds: [segmentId1] } - ) - - // check that nothing was done - expect(collection.remove).toHaveBeenCalledTimes(1) - expect(collection.remove).toHaveBeenLastCalledWith(expect.anything()) - expect(collection.replace).toHaveBeenCalledTimes(1) - expect(generateNotesForSegment.generateNotesForSegment).toHaveBeenCalledTimes(3) - }) - - describe('generateNotesForSegment calls', () => { - const newCache = createAndPopulateMockCache() - newCache.Parts.insert({ - _id: 'part0', - _rank: 1, - segmentId: segmentId0, - rundownId: rundownId, - notes: [], - title: 'Some part', - invalid: false, - invalidReason: undefined, - }) - newCache.Parts.insert({ - _id: 'part1', - _rank: 2, - segmentId: segmentId0, - rundownId: rundownId, - notes: [], - title: 'Another part', - invalid: false, - invalidReason: undefined, - }) - newCache.Parts.insert({ - _id: 'part2', - _rank: 1, - segmentId: segmentId1, - rundownId: rundownId, - notes: [], - title: 'Next part', - invalid: false, - invalidReason: undefined, - }) - newCache.DeletedPartInstances.insert({ - _id: 'instance0', - segmentId: segmentId0, - rundownId: rundownId, - orphaned: undefined, - reset: false, - part: 'part' as any, - }) - - testInFiber('segment changed', async () => { - const playlistId = protectString('playlist0') - const state: Partial = {} - const collection = createSpyPublishCollection() - - // start out normally - await manipulateUISegmentPartNotesPublicationData( - { - playlistId, - }, - state, - collection, - { newCache } - ) - - // Some notes should have been added - expect(collection.commitChanges()).toEqual([ - defaultNotes, - { added: defaultNotes, changed: [], removed: [] }, - ]) - collection.clearAllMocks() - expect(generateNotesForSegment.generateNotesForSegment).toHaveBeenCalledTimes(2) - expect(generateNotesForSegment.generateNotesForSegment).toHaveBeenCalledWith( - playlistId, - { - _id: 'segment0', - _rank: 1, - name: 'Segment 0', - notes: [], - orphaned: undefined, - rundownId: 'rundown0', - }, - 'NRCS+ 2000', - [ - { - _id: 'part0', - _rank: 1, - invalid: false, - notes: [], - rundownId: 'rundown0', - segmentId: 'segment0', - title: 'Some part', - }, - { - _id: 'part1', - _rank: 2, - invalid: false, - notes: [], - rundownId: 'rundown0', - segmentId: 'segment0', - title: 'Another part', - }, - ], - [ - { - _id: 'instance0', - part: 'part', - reset: false, - rundownId: 'rundown0', - segmentId: 'segment0', - }, - ] - ) - expect(generateNotesForSegment.generateNotesForSegment).toHaveBeenCalledWith( - playlistId, - { - _id: 'segment1', - _rank: 1, - name: 'Segment 1', - notes: [], - orphaned: undefined, - rundownId: 'rundown0', - }, - 'NRCS+ 2000', - [ - { - _id: 'part2', - _rank: 1, - invalid: false, - notes: [], - rundownId: 'rundown0', - segmentId: 'segment1', - title: 'Next part', - }, - ], - [] - ) - }) - }) -})