@@ -11,10 +11,7 @@ import { getCurrentTime } from '../../lib/lib'
11
11
import { waitUntil } from '../../../__mocks__/helpers/jest'
12
12
import { setupDefaultStudioEnvironment , DefaultEnvironment } from '../../../__mocks__/helpers/database'
13
13
import { setLogLevel } from '../../logging'
14
- import {
15
- IngestDeviceSettings ,
16
- IngestDeviceSecretSettings ,
17
- } from '@sofie-automation/corelib/dist/dataModel/PeripheralDeviceSettings/ingestDevice'
14
+ import { IngestDeviceSecretSettings } from '@sofie-automation/corelib/dist/dataModel/PeripheralDeviceSettings/ingestDevice'
18
15
import { MediaWorkFlow } from '@sofie-automation/shared-lib/dist/core/model/MediaWorkFlows'
19
16
import { MediaWorkFlowStep } from '@sofie-automation/shared-lib/dist/core/model/MediaWorkFlowSteps'
20
17
import { MediaManagerAPI } from '@sofie-automation/meteor-lib/dist/api/mediaManager'
@@ -412,7 +409,7 @@ describe('test peripheralDevice general API methods', () => {
412
409
expect ( QueueStudioJobSpy ) . toHaveBeenNthCalledWith (
413
410
1 ,
414
411
StudioJobs . OnPlayoutPlaybackChanged ,
415
- device . studioId ,
412
+ device . studioAndConfigId ! . studioId ,
416
413
literal < Parameters < StudioJobFunc [ StudioJobs . OnPlayoutPlaybackChanged ] > [ 0 ] > ( {
417
414
playlistId : rundownPlaylistID ,
418
415
changes : [
@@ -474,7 +471,7 @@ describe('test peripheralDevice general API methods', () => {
474
471
expect ( QueueStudioJobSpy ) . toHaveBeenNthCalledWith (
475
472
1 ,
476
473
StudioJobs . OnTimelineTriggerTime ,
477
- device . studioId ,
474
+ device . studioAndConfigId ! . studioId ,
478
475
literal < OnTimelineTriggerTimeProps > ( {
479
476
results : timelineTriggerTimeResult ,
480
477
} )
@@ -556,7 +553,7 @@ describe('test peripheralDevice general API methods', () => {
556
553
expect ( ( deviceWithSecretToken . secretSettings as IngestDeviceSecretSettings ) . accessToken ) . toBe (
557
554
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
558
555
)
559
- expect ( ( deviceWithSecretToken . settings as IngestDeviceSettings ) . secretAccessToken ) . toBe ( true )
556
+ expect ( deviceWithSecretToken . secretSettingsStatus ?. accessToken ) . toBe ( true )
560
557
} )
561
558
562
559
test ( 'uninitialize' , async ( ) => {
@@ -643,8 +640,10 @@ describe('test peripheralDevice general API methods', () => {
643
640
organizationId : null ,
644
641
name : 'Mock Media Manager' ,
645
642
deviceName : 'Media Manager' ,
646
- studioId : env . studio . _id ,
647
- settings : { } ,
643
+ studioAndConfigId : {
644
+ studioId : env . studio . _id ,
645
+ configId : 'test' ,
646
+ } ,
648
647
category : PeripheralDeviceCategory . MEDIA_MANAGER ,
649
648
configManifest : {
650
649
deviceConfigSchema : JSONBlobStringify ( { } ) ,
@@ -670,7 +669,7 @@ describe('test peripheralDevice general API methods', () => {
670
669
deviceId : device . _id ,
671
670
priority : 1 ,
672
671
source : 'MockSource' ,
673
- studioId : device . studioId ! ,
672
+ studioId : device . studioAndConfigId ! . studioId ,
674
673
finished : false ,
675
674
success : false ,
676
675
} )
@@ -682,7 +681,7 @@ describe('test peripheralDevice general API methods', () => {
682
681
deviceId : device . _id ,
683
682
priority : 2 ,
684
683
status : MediaManagerAPI . WorkStepStatus . IDLE ,
685
- studioId : device . studioId ! ,
684
+ studioId : device . studioAndConfigId ! . studioId ,
686
685
workFlowId : workFlowId ,
687
686
} )
688
687
await MediaWorkFlowSteps . insertAsync ( {
@@ -693,14 +692,14 @@ describe('test peripheralDevice general API methods', () => {
693
692
deviceId : device . _id ,
694
693
priority : 1 ,
695
694
status : MediaManagerAPI . WorkStepStatus . IDLE ,
696
- studioId : device . studioId ! ,
695
+ studioId : device . studioAndConfigId ! . studioId ,
697
696
workFlowId : workFlowId ,
698
697
} )
699
698
} )
700
699
test ( 'getMediaWorkFlowRevisions' , async ( ) => {
701
700
const workFlows = (
702
701
await MediaWorkFlows . findFetchAsync ( {
703
- studioId : device . studioId ,
702
+ studioId : device . studioAndConfigId ! . studioId ,
704
703
} )
705
704
) . map ( ( wf ) => ( {
706
705
_id : wf . _id ,
@@ -714,7 +713,7 @@ describe('test peripheralDevice general API methods', () => {
714
713
test ( 'getMediaWorkFlowStepRevisions' , async ( ) => {
715
714
const workFlowSteps = (
716
715
await MediaWorkFlowSteps . findFetchAsync ( {
717
- studioId : device . studioId ,
716
+ studioId : device . studioAndConfigId ! . studioId ,
718
717
} )
719
718
) . map ( ( wf ) => ( {
720
719
_id : wf . _id ,
@@ -799,8 +798,10 @@ describe('test peripheralDevice general API methods', () => {
799
798
organizationId : null ,
800
799
name : 'Mock Media Manager' ,
801
800
deviceName : 'Media Manager' ,
802
- studioId : env . studio . _id ,
803
- settings : { } ,
801
+ studioAndConfigId : {
802
+ studioId : env . studio . _id ,
803
+ configId : 'test' ,
804
+ } ,
804
805
category : PeripheralDeviceCategory . MEDIA_MANAGER ,
805
806
configManifest : {
806
807
deviceConfigSchema : JSONBlobStringify ( { } ) ,
@@ -834,7 +835,7 @@ describe('test peripheralDevice general API methods', () => {
834
835
mediaSize : 10 ,
835
836
mediaTime : 0 ,
836
837
objId : MOCK_OBJID ,
837
- studioId : device . studioId ! ,
838
+ studioId : device . studioAndConfigId ! . studioId ,
838
839
thumbSize : 0 ,
839
840
thumbTime : 0 ,
840
841
tinf : '' ,
@@ -843,7 +844,7 @@ describe('test peripheralDevice general API methods', () => {
843
844
test ( 'getMediaObjectRevisions' , async ( ) => {
844
845
const mobjects = (
845
846
await MediaObjects . findFetchAsync ( {
846
- studioId : device . studioId ,
847
+ studioId : device . studioAndConfigId ! . studioId ,
847
848
} )
848
849
) . map ( ( mo ) => ( {
849
850
_id : mo . _id ,
@@ -864,7 +865,7 @@ describe('test peripheralDevice general API methods', () => {
864
865
test ( 'update' , async ( ) => {
865
866
const mo = ( await MediaObjects . findOneAsync ( {
866
867
collectionId : MOCK_COLLECTION ,
867
- studioId : device . studioId ! ,
868
+ studioId : device . studioAndConfigId ! . studioId ,
868
869
} ) ) as MediaObject
869
870
expect ( mo ) . toBeTruthy ( )
870
871
@@ -882,14 +883,14 @@ describe('test peripheralDevice general API methods', () => {
882
883
883
884
const updateMo = await MediaObjects . findOneAsync ( {
884
885
collectionId : MOCK_COLLECTION ,
885
- studioId : device . studioId ! ,
886
+ studioId : device . studioAndConfigId ! . studioId ,
886
887
} )
887
888
expect ( updateMo ) . toMatchObject ( newMo )
888
889
} )
889
890
test ( 'remove' , async ( ) => {
890
891
const mo = ( await MediaObjects . findOneAsync ( {
891
892
collectionId : MOCK_COLLECTION ,
892
- studioId : device . studioId ! ,
893
+ studioId : device . studioAndConfigId ! . studioId ,
893
894
} ) ) as MediaObject
894
895
expect ( mo ) . toBeTruthy ( )
895
896
@@ -903,7 +904,7 @@ describe('test peripheralDevice general API methods', () => {
903
904
904
905
const updateMo = await MediaObjects . findOneAsync ( {
905
906
collectionId : MOCK_COLLECTION ,
906
- studioId : device . studioId ! ,
907
+ studioId : device . studioAndConfigId ! . studioId ,
907
908
} )
908
909
expect ( updateMo ) . toBeFalsy ( )
909
910
} )
0 commit comments