@@ -750,6 +750,53 @@ describe.each([
750750 } ) ;
751751 } ) ;
752752
753+ test ( "PiP tile in expanded spotlight layout avoids redundantly showing local user" , ( ) => {
754+ withTestScheduler ( ( { behavior, schedule, expectObservable } ) => {
755+ // Switch to spotlight immediately
756+ const modeInputMarbles = " s" ;
757+ // And expand the spotlight immediately
758+ const expandInputMarbles = " a" ;
759+ // First no one else is in the call, then Alice joins
760+ const participantInputMarbles = "ab" ;
761+ // First local user should be in the spotlight, then they appear in PiP
762+ // only once Alice has joined
763+ const expectedLayoutMarbles = " ab" ;
764+
765+ withCallViewModel (
766+ {
767+ rtcMembers$ : behavior ( participantInputMarbles , {
768+ a : [ localRtcMember ] ,
769+ b : [ localRtcMember , aliceRtcMember ] ,
770+ } ) ,
771+ } ,
772+ ( vm ) => {
773+ schedule ( modeInputMarbles , {
774+ s : ( ) => vm . setGridMode ( "spotlight" ) ,
775+ } ) ;
776+ schedule ( expandInputMarbles , {
777+ a : ( ) => vm . toggleSpotlightExpanded$ . value ! ( ) ,
778+ } ) ;
779+
780+ expectObservable ( summarizeLayout$ ( vm . layout$ ) ) . toBe (
781+ expectedLayoutMarbles ,
782+ {
783+ a : {
784+ type : "spotlight-expanded" ,
785+ spotlight : [ `${ localId } :0` ] ,
786+ pip : undefined ,
787+ } ,
788+ b : {
789+ type : "spotlight-expanded" ,
790+ spotlight : [ `${ aliceId } :0` ] ,
791+ pip : `${ localId } :0` ,
792+ } ,
793+ } ,
794+ ) ;
795+ } ,
796+ ) ;
797+ } ) ;
798+ } ) ;
799+
753800 test ( "spotlight remembers whether it's expanded" , ( ) => {
754801 withTestScheduler ( ( { schedule, expectObservable } ) => {
755802 // Start in spotlight mode, then switch to grid and back to spotlight a
0 commit comments