@@ -7,6 +7,7 @@ const fixture = vi.hoisted(() => ({
77 active : true ,
88 currentThread : "thread-a" ,
99 currentEnvironment : "environment" ,
10+ fullscreenTarget : null as { threadId : string ; environmentId : string } | null ,
1011 stop : vi . fn ( ) ,
1112} ) ) ;
1213const RouteName = createContext ( "Thread" ) ;
@@ -27,6 +28,9 @@ vi.mock("@react-navigation/native", () => ({
2728 name : "Thread" ,
2829 params : { threadId : fixture . currentThread , environmentId : fixture . currentEnvironment } ,
2930 } ,
31+ ...( fixture . fullscreenTarget === null
32+ ? [ ]
33+ : [ { name : "ThreadInspectorFullscreen" , params : fixture . fullscreenTarget } ] ) ,
3034 ] ,
3135 } ) ,
3236} ) ) ;
@@ -53,6 +57,7 @@ beforeEach(() => {
5357 fixture . active = true ;
5458 fixture . currentThread = "thread-a" ;
5559 fixture . currentEnvironment = "environment" ;
60+ fixture . fullscreenTarget = null ;
5661 fixture . stop . mockClear ( ) ;
5762 ( globalThis as { IS_REACT_ACT_ENVIRONMENT ?: boolean } ) . IS_REACT_ACT_ENVIRONMENT = true ;
5863 root = createRoot ( document . createElement ( "div" ) ) ;
@@ -80,12 +85,17 @@ it("keeps voice running when Files closes and stops when the owning Thread leave
8085 act ( ( ) => root . unmount ( ) ) ;
8186 expect ( fixture . stop ) . toHaveBeenCalledTimes ( 1 ) ;
8287} ) ;
83- it . each ( [ "thread" , "environment" ] ) (
88+ it . each ( [ "thread" , "environment" , "fullscreen thread" , "fullscreen environment" ] ) (
8489 "stops the previous thread when navigation selects a different %s" ,
8590 ( changed ) => {
8691 render ( false ) ;
8792 if ( changed === "thread" ) fixture . currentThread = "thread-b" ;
88- else fixture . currentEnvironment = "another-environment" ;
93+ else if ( changed === "environment" ) fixture . currentEnvironment = "another-environment" ;
94+ else
95+ fixture . fullscreenTarget = {
96+ threadId : changed === "fullscreen thread" ? "thread-b" : "thread-a" ,
97+ environmentId : changed === "fullscreen environment" ? "another-environment" : "environment" ,
98+ } ;
8999 render ( false ) ;
90100 expect ( fixture . stop ) . toHaveBeenCalledTimes ( 1 ) ;
91101 } ,
0 commit comments