@@ -151,4 +151,54 @@ describe('VisionCamera - Devices', () => {
151151 expect ( factory . userPreferredCamera ?. id ) . toBe ( back . id )
152152 factory . userPreferredCamera = previous
153153 } )
154+
155+ it ( 'returns an empty supportedMultiCamDeviceCombinations array when the platform does not support multi-cam' , ( ) => {
156+ if ( VisionCamera . supportsMultiCamSessions ) {
157+ console . log (
158+ '[SKIP] supportedMultiCamDeviceCombinations empty: platform supports multi-cam' ,
159+ )
160+ return
161+ }
162+ expect ( factory . supportedMultiCamDeviceCombinations . length ) . toBe ( 0 )
163+ } )
164+
165+ it ( 'returns at least one supportedMultiCamDeviceCombinations combination when the platform supports multi-cam' , ( ) => {
166+ if ( ! VisionCamera . supportsMultiCamSessions ) {
167+ console . log (
168+ '[SKIP] supportedMultiCamDeviceCombinations non-empty: multi-cam not supported on this platform' ,
169+ )
170+ return
171+ }
172+ expect ( factory . supportedMultiCamDeviceCombinations . length ) . toBeGreaterThanOrEqual ( 1 )
173+ } )
174+
175+ it ( 'every device in a supportedMultiCamDeviceCombinations combination is also present in cameraDevices' , ( ) => {
176+ const combinations = factory . supportedMultiCamDeviceCombinations
177+ if ( combinations . length === 0 ) {
178+ console . log (
179+ '[SKIP] supportedMultiCamDeviceCombinations device lookup: no combinations on this platform' ,
180+ )
181+ return
182+ }
183+ const knownIds = new Set ( factory . cameraDevices . map ( ( d ) => d . id ) )
184+ for ( const combination of combinations ) {
185+ expect ( combination . length ) . toBeGreaterThan ( 0 )
186+ for ( const device of combination ) {
187+ expect ( knownIds . has ( device . id ) ) . toBe ( true )
188+ }
189+ }
190+ } )
191+
192+ it ( 'logs every supported multi-cam device combination' , ( ) => {
193+ const combinations = factory . supportedMultiCamDeviceCombinations
194+ console . log (
195+ `supportedMultiCamDeviceCombinations: ${ combinations . length } combinations` ,
196+ )
197+ for ( const [ index , combination ] of combinations . entries ( ) ) {
198+ const description = combination
199+ . map ( ( d ) => `${ d . position } :${ d . id } ` )
200+ . join ( ', ' )
201+ console . log ( ` [${ index } ] ${ description } ` )
202+ }
203+ } )
154204} )
0 commit comments