Skip to content

Commit bbb896c

Browse files
committed
Fix test by expanding mock objects
1 parent c5acb11 commit bbb896c

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

packages/job-worker/src/blueprints/__tests__/context-OnTakeContext.test.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { mock } from 'jest-mock-extended'
66
import { PartAndPieceInstanceActionService } from '../context/services/PartAndPieceInstanceActionService.js'
77
import { OnTakeContext } from '../context/index.js'
88
import { DBPart } from '@sofie-automation/corelib/dist/dataModel/Part'
9+
import { PartId, RundownId, SegmentId } from '@sofie-automation/corelib/dist/dataModel/Ids'
10+
import { protectString } from '@sofie-automation/corelib/dist/protectedString'
911
import { PlayoutModelImpl } from '../../playout/model/implementation/PlayoutModelImpl.js'
1012

1113
describe('Test blueprint api context', () => {
@@ -107,8 +109,30 @@ describe('Test blueprint api context', () => {
107109

108110
mockPlayoutModel.getAllOrderedParts.mockReturnValue(
109111
mock([
110-
{ _id: 'part1', title: 'Part 1', invalid: false, floated: false } as unknown as DBPart,
111-
{ _id: 'part2', title: 'Part 2', invalid: false, floated: false } as unknown as DBPart,
112+
{
113+
_id: protectString<PartId>('part1'),
114+
title: 'Part 1',
115+
invalid: false,
116+
floated: false,
117+
_rank: 1,
118+
rundownId: protectString<RundownId>('rundown1'),
119+
externalId: 'ext1',
120+
segmentId: protectString<SegmentId>('seg1'),
121+
expectedDurationWithTransition: 1000,
122+
userEditOperations: [],
123+
} as DBPart,
124+
{
125+
_id: protectString<PartId>('part2'),
126+
title: 'Part 2',
127+
invalid: false,
128+
floated: false,
129+
_rank: 1,
130+
rundownId: protectString<RundownId>('rundown1'),
131+
externalId: 'ext1',
132+
segmentId: protectString<SegmentId>('seg1'),
133+
expectedDurationWithTransition: 1000,
134+
userEditOperations: [],
135+
} as unknown as DBPart,
112136
])
113137
)
114138

0 commit comments

Comments
 (0)