@@ -11,10 +11,7 @@ import { getCurrentTime } from '../../lib/lib'
1111import { waitUntil } from '../../../__mocks__/helpers/jest'
1212import { setupDefaultStudioEnvironment , DefaultEnvironment } from '../../../__mocks__/helpers/database'
1313import { 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'
1815import { MediaWorkFlow } from '@sofie-automation/shared-lib/dist/core/model/MediaWorkFlows'
1916import { MediaWorkFlowStep } from '@sofie-automation/shared-lib/dist/core/model/MediaWorkFlowSteps'
2017import { MediaManagerAPI } from '@sofie-automation/meteor-lib/dist/api/mediaManager'
@@ -412,7 +409,7 @@ describe('test peripheralDevice general API methods', () => {
412409 expect ( QueueStudioJobSpy ) . toHaveBeenNthCalledWith (
413410 1 ,
414411 StudioJobs . OnPlayoutPlaybackChanged ,
415- device . studioId ,
412+ device . studioAndConfigId ! . studioId ,
416413 literal < Parameters < StudioJobFunc [ StudioJobs . OnPlayoutPlaybackChanged ] > [ 0 ] > ( {
417414 playlistId : rundownPlaylistID ,
418415 changes : [
@@ -474,7 +471,7 @@ describe('test peripheralDevice general API methods', () => {
474471 expect ( QueueStudioJobSpy ) . toHaveBeenNthCalledWith (
475472 1 ,
476473 StudioJobs . OnTimelineTriggerTime ,
477- device . studioId ,
474+ device . studioAndConfigId ! . studioId ,
478475 literal < OnTimelineTriggerTimeProps > ( {
479476 results : timelineTriggerTimeResult ,
480477 } )
@@ -556,7 +553,7 @@ describe('test peripheralDevice general API methods', () => {
556553 expect ( ( deviceWithSecretToken . secretSettings as IngestDeviceSecretSettings ) . accessToken ) . toBe (
557554 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
558555 )
559- expect ( ( deviceWithSecretToken . settings as IngestDeviceSettings ) . secretAccessToken ) . toBe ( true )
556+ expect ( deviceWithSecretToken . secretSettingsStatus ?. accessToken ) . toBe ( true )
560557 } )
561558
562559 test ( 'uninitialize' , async ( ) => {
@@ -643,8 +640,10 @@ describe('test peripheralDevice general API methods', () => {
643640 organizationId : null ,
644641 name : 'Mock Media Manager' ,
645642 deviceName : 'Media Manager' ,
646- studioId : env . studio . _id ,
647- settings : { } ,
643+ studioAndConfigId : {
644+ studioId : env . studio . _id ,
645+ configId : 'test' ,
646+ } ,
648647 category : PeripheralDeviceCategory . MEDIA_MANAGER ,
649648 configManifest : {
650649 deviceConfigSchema : JSONBlobStringify ( { } ) ,
@@ -670,7 +669,7 @@ describe('test peripheralDevice general API methods', () => {
670669 deviceId : device . _id ,
671670 priority : 1 ,
672671 source : 'MockSource' ,
673- studioId : device . studioId ! ,
672+ studioId : device . studioAndConfigId ! . studioId ,
674673 finished : false ,
675674 success : false ,
676675 } )
@@ -682,7 +681,7 @@ describe('test peripheralDevice general API methods', () => {
682681 deviceId : device . _id ,
683682 priority : 2 ,
684683 status : MediaManagerAPI . WorkStepStatus . IDLE ,
685- studioId : device . studioId ! ,
684+ studioId : device . studioAndConfigId ! . studioId ,
686685 workFlowId : workFlowId ,
687686 } )
688687 await MediaWorkFlowSteps . insertAsync ( {
@@ -693,14 +692,14 @@ describe('test peripheralDevice general API methods', () => {
693692 deviceId : device . _id ,
694693 priority : 1 ,
695694 status : MediaManagerAPI . WorkStepStatus . IDLE ,
696- studioId : device . studioId ! ,
695+ studioId : device . studioAndConfigId ! . studioId ,
697696 workFlowId : workFlowId ,
698697 } )
699698 } )
700699 test ( 'getMediaWorkFlowRevisions' , async ( ) => {
701700 const workFlows = (
702701 await MediaWorkFlows . findFetchAsync ( {
703- studioId : device . studioId ,
702+ studioId : device . studioAndConfigId ! . studioId ,
704703 } )
705704 ) . map ( ( wf ) => ( {
706705 _id : wf . _id ,
@@ -714,7 +713,7 @@ describe('test peripheralDevice general API methods', () => {
714713 test ( 'getMediaWorkFlowStepRevisions' , async ( ) => {
715714 const workFlowSteps = (
716715 await MediaWorkFlowSteps . findFetchAsync ( {
717- studioId : device . studioId ,
716+ studioId : device . studioAndConfigId ! . studioId ,
718717 } )
719718 ) . map ( ( wf ) => ( {
720719 _id : wf . _id ,
@@ -799,8 +798,10 @@ describe('test peripheralDevice general API methods', () => {
799798 organizationId : null ,
800799 name : 'Mock Media Manager' ,
801800 deviceName : 'Media Manager' ,
802- studioId : env . studio . _id ,
803- settings : { } ,
801+ studioAndConfigId : {
802+ studioId : env . studio . _id ,
803+ configId : 'test' ,
804+ } ,
804805 category : PeripheralDeviceCategory . MEDIA_MANAGER ,
805806 configManifest : {
806807 deviceConfigSchema : JSONBlobStringify ( { } ) ,
@@ -834,7 +835,7 @@ describe('test peripheralDevice general API methods', () => {
834835 mediaSize : 10 ,
835836 mediaTime : 0 ,
836837 objId : MOCK_OBJID ,
837- studioId : device . studioId ! ,
838+ studioId : device . studioAndConfigId ! . studioId ,
838839 thumbSize : 0 ,
839840 thumbTime : 0 ,
840841 tinf : '' ,
@@ -843,7 +844,7 @@ describe('test peripheralDevice general API methods', () => {
843844 test ( 'getMediaObjectRevisions' , async ( ) => {
844845 const mobjects = (
845846 await MediaObjects . findFetchAsync ( {
846- studioId : device . studioId ,
847+ studioId : device . studioAndConfigId ! . studioId ,
847848 } )
848849 ) . map ( ( mo ) => ( {
849850 _id : mo . _id ,
@@ -864,7 +865,7 @@ describe('test peripheralDevice general API methods', () => {
864865 test ( 'update' , async ( ) => {
865866 const mo = ( await MediaObjects . findOneAsync ( {
866867 collectionId : MOCK_COLLECTION ,
867- studioId : device . studioId ! ,
868+ studioId : device . studioAndConfigId ! . studioId ,
868869 } ) ) as MediaObject
869870 expect ( mo ) . toBeTruthy ( )
870871
@@ -882,14 +883,14 @@ describe('test peripheralDevice general API methods', () => {
882883
883884 const updateMo = await MediaObjects . findOneAsync ( {
884885 collectionId : MOCK_COLLECTION ,
885- studioId : device . studioId ! ,
886+ studioId : device . studioAndConfigId ! . studioId ,
886887 } )
887888 expect ( updateMo ) . toMatchObject ( newMo )
888889 } )
889890 test ( 'remove' , async ( ) => {
890891 const mo = ( await MediaObjects . findOneAsync ( {
891892 collectionId : MOCK_COLLECTION ,
892- studioId : device . studioId ! ,
893+ studioId : device . studioAndConfigId ! . studioId ,
893894 } ) ) as MediaObject
894895 expect ( mo ) . toBeTruthy ( )
895896
@@ -903,7 +904,7 @@ describe('test peripheralDevice general API methods', () => {
903904
904905 const updateMo = await MediaObjects . findOneAsync ( {
905906 collectionId : MOCK_COLLECTION ,
906- studioId : device . studioId ! ,
907+ studioId : device . studioAndConfigId ! . studioId ,
907908 } )
908909 expect ( updateMo ) . toBeFalsy ( )
909910 } )
0 commit comments