Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion packages/job-worker/src/__mocks__/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
IBlueprintSegment,
ISegmentUserContext,
IShowStyleContext,
IStudioSettings,
IngestSegment,
PlaylistTimingType,
ShowStyleBlueprintManifest,
Expand Down Expand Up @@ -59,7 +60,10 @@ import { processShowStyleBase, processShowStyleVariant } from '../jobs/showStyle
import { defaultStudio } from './defaultCollectionObjects'
import { convertStudioToJobStudio } from '../jobs/studio'

export function setupDefaultJobEnvironment(studioId?: StudioId): MockJobContext {
export function setupDefaultJobEnvironment(
studioId?: StudioId,
studioSettings?: Partial<IStudioSettings>
): MockJobContext {
const { mockCollections, jobCollections } = getMockCollections()

// We don't bother 'saving' this to the db, as usually nothing will load it
Expand All @@ -70,6 +74,16 @@ export function setupDefaultJobEnvironment(studioId?: StudioId): MockJobContext
blueprintId: protectString('studioBlueprint0'),
}

if (studioSettings) {
studio.settingsWithOverrides = {
...studio.settingsWithOverrides,
defaults: {
...studio.settingsWithOverrides.defaults,
...studioSettings,
},
}
}

return new MockJobContext(jobCollections, mockCollections, studio)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,40 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Timeline Adlib pieces Current part with preroll 1`] = `
exports[`Timeline Multi-gateway mode In transitions inTransition with existing infinites 1`] = `
[
{
"_id": "mockStudio0",
"generated": 12345,
"generationVersions": {
"blueprintId": "studioBlueprint0",
"blueprintVersion": "0.0.0",
"core": "0.0.0-test",
"studio": "asdf",
},
"timelineBlob": "[]",
"timelineHash": "randomId9011",
},
]
`;

exports[`Timeline Multi-gateway mode Infinite Pieces Infinite Piece has stable timing across timeline regenerations after onPlayoutPlaybackChanged 1`] = `
[
{
"_id": "mockStudio0",
"generated": 12345,
"generationVersions": {
"blueprintId": "studioBlueprint0",
"blueprintVersion": "0.0.0",
"core": "0.0.0-test",
"studio": "asdf",
},
"timelineBlob": "[]",
"timelineHash": "randomId9010",
},
]
`;

exports[`Timeline Single-gateway mode Adlib pieces Current part with preroll 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -17,7 +51,7 @@ exports[`Timeline Adlib pieces Current part with preroll 1`] = `
]
`;

exports[`Timeline Adlib pieces Current part with preroll and adlib preroll 1`] = `
exports[`Timeline Single-gateway mode Adlib pieces Current part with preroll and adlib preroll 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -34,7 +68,7 @@ exports[`Timeline Adlib pieces Current part with preroll and adlib preroll 1`] =
]
`;

exports[`Timeline Basic rundown 1`] = `
exports[`Timeline Single-gateway mode Basic rundown 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -51,7 +85,7 @@ exports[`Timeline Basic rundown 1`] = `
]
`;

exports[`Timeline Basic rundown 2`] = `
exports[`Timeline Single-gateway mode Basic rundown 2`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -68,7 +102,7 @@ exports[`Timeline Basic rundown 2`] = `
]
`;

exports[`Timeline In transitions Basic inTransition 1`] = `
exports[`Timeline Single-gateway mode In transitions Basic inTransition 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -85,7 +119,7 @@ exports[`Timeline In transitions Basic inTransition 1`] = `
]
`;

exports[`Timeline In transitions Basic inTransition with contentDelay + preroll 1`] = `
exports[`Timeline Single-gateway mode In transitions Basic inTransition with contentDelay + preroll 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -102,7 +136,7 @@ exports[`Timeline In transitions Basic inTransition with contentDelay + preroll
]
`;

exports[`Timeline In transitions Basic inTransition with contentDelay 1`] = `
exports[`Timeline Single-gateway mode In transitions Basic inTransition with contentDelay 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -119,7 +153,7 @@ exports[`Timeline In transitions Basic inTransition with contentDelay 1`] = `
]
`;

exports[`Timeline In transitions Basic inTransition with planned pieces 1`] = `
exports[`Timeline Single-gateway mode In transitions Basic inTransition with planned pieces 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -136,7 +170,7 @@ exports[`Timeline In transitions Basic inTransition with planned pieces 1`] = `
]
`;

exports[`Timeline In transitions Preroll 1`] = `
exports[`Timeline Single-gateway mode In transitions Preroll 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -153,7 +187,7 @@ exports[`Timeline In transitions Preroll 1`] = `
]
`;

exports[`Timeline In transitions inTransition disabled 1`] = `
exports[`Timeline Single-gateway mode In transitions inTransition disabled 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -170,7 +204,7 @@ exports[`Timeline In transitions inTransition disabled 1`] = `
]
`;

exports[`Timeline In transitions inTransition is disabled during hold 1`] = `
exports[`Timeline Single-gateway mode In transitions inTransition is disabled during hold 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -187,7 +221,7 @@ exports[`Timeline In transitions inTransition is disabled during hold 1`] = `
]
`;

exports[`Timeline In transitions inTransition with existing infinites 1`] = `
exports[`Timeline Single-gateway mode In transitions inTransition with existing infinites 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -204,7 +238,7 @@ exports[`Timeline In transitions inTransition with existing infinites 1`] = `
]
`;

exports[`Timeline In transitions inTransition with new infinite 1`] = `
exports[`Timeline Single-gateway mode In transitions inTransition with new infinite 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -221,7 +255,7 @@ exports[`Timeline In transitions inTransition with new infinite 1`] = `
]
`;

exports[`Timeline Infinite Pieces Infinite Piece has stable timing across timeline regenerations with/without plannedStartedPlayback 1`] = `
exports[`Timeline Single-gateway mode Infinite Pieces Infinite Piece has stable timing across timeline regenerations with/without plannedStartedPlayback 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -238,7 +272,7 @@ exports[`Timeline Infinite Pieces Infinite Piece has stable timing across timeli
]
`;

exports[`Timeline Out transitions Basic outTransition 1`] = `
exports[`Timeline Single-gateway mode Out transitions Basic outTransition 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -255,7 +289,7 @@ exports[`Timeline Out transitions Basic outTransition 1`] = `
]
`;

exports[`Timeline Out transitions outTransition + inTransition 1`] = `
exports[`Timeline Single-gateway mode Out transitions outTransition + inTransition 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -272,7 +306,7 @@ exports[`Timeline Out transitions outTransition + inTransition 1`] = `
]
`;

exports[`Timeline Out transitions outTransition + preroll (2) 1`] = `
exports[`Timeline Single-gateway mode Out transitions outTransition + preroll (2) 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -289,7 +323,7 @@ exports[`Timeline Out transitions outTransition + preroll (2) 1`] = `
]
`;

exports[`Timeline Out transitions outTransition + preroll 1`] = `
exports[`Timeline Single-gateway mode Out transitions outTransition + preroll 1`] = `
[
{
"_id": "mockStudio0",
Expand All @@ -306,7 +340,7 @@ exports[`Timeline Out transitions outTransition + preroll 1`] = `
]
`;

exports[`Timeline Out transitions outTransition is disabled during hold 1`] = `
exports[`Timeline Single-gateway mode Out transitions outTransition is disabled during hold 1`] = `
[
{
"_id": "mockStudio0",
Expand Down
Loading
Loading