@@ -33,20 +33,26 @@ it("revokes a pending selection on disposal and never starts it", async () => {
3333 scope : "https://fixture.example:viewer" ,
3434 } ;
3535 let dispose ! : ( ) => void ;
36- let Component ! : React . ComponentType ;
36+ let Component ! : React . ComponentType < {
37+ community ?: { id : string ; name : string } ;
38+ } > ;
3739 const ctx = {
3840 relay : { snapshot : ( ) => snapshot , subscribe : ( ) => ( ) => { } } ,
3941 effect : ( setup : ( ) => ( ) => void ) => {
4042 dispose = setup ( ) ;
4143 } ,
4244 settingsCards : {
43- register : ( card : { component : React . ComponentType } ) => {
45+ register : ( card : {
46+ component : React . ComponentType < {
47+ community ?: { id : string ; name : string } ;
48+ } > ;
49+ } ) => {
4450 Component = card . component ;
4551 } ,
4652 } ,
4753 } as unknown as Parameters < PluginModule [ "apply" ] > [ 0 ] ;
4854 apply ( ctx ) ;
49- render ( < Component /> ) ;
55+ render ( < Component community = { { id : "primary" , name : "Primary" } } /> ) ;
5056 await waitFor ( ( ) =>
5157 expect ( native . invoke ) . toHaveBeenCalledWith ( "mesh_compute_select" , {
5258 community : "https://fixture.example" ,
@@ -95,7 +101,9 @@ it("preserves the running lease through reconnect and revokes on identity change
95101 } ;
96102 const listeners = new Set < ( ) => void > ( ) ;
97103 let dispose ! : ( ) => void ;
98- let Component ! : React . ComponentType ;
104+ let Component ! : React . ComponentType < {
105+ community ?: { id : string ; name : string } ;
106+ } > ;
99107 const ctx = {
100108 relay : {
101109 snapshot : ( ) => snapshot ,
@@ -108,13 +116,17 @@ it("preserves the running lease through reconnect and revokes on identity change
108116 dispose = setup ( ) ;
109117 } ,
110118 settingsCards : {
111- register : ( card : { component : React . ComponentType } ) => {
119+ register : ( card : {
120+ component : React . ComponentType < {
121+ community ?: { id : string ; name : string } ;
122+ } > ;
123+ } ) => {
112124 Component = card . component ;
113125 } ,
114126 } ,
115127 } as unknown as Parameters < PluginModule [ "apply" ] > [ 0 ] ;
116128 apply ( ctx ) ;
117- render ( < Component /> ) ;
129+ render ( < Component community = { { id : "primary" , name : "Primary" } } /> ) ;
118130 await waitFor ( ( ) =>
119131 expect (
120132 screen . getByRole ( "button" , { name : "Connect to community compute" } ) ,
@@ -196,20 +208,26 @@ it("renders Running without claiming connectivity, stops by lease, and separates
196208 viewer : "viewer" ,
197209 scope : "https://fixture.example:viewer" ,
198210 } ;
199- let Component ! : React . ComponentType ;
211+ let Component ! : React . ComponentType < {
212+ community ?: { id : string ; name : string } ;
213+ } > ;
200214 let dispose ! : ( ) => void ;
201215 apply ( {
202216 relay : { snapshot : ( ) => snapshot , subscribe : ( ) => ( ) => { } } ,
203217 effect : ( setup : ( ) => ( ) => void ) => {
204218 dispose = setup ( ) ;
205219 } ,
206220 settingsCards : {
207- register : ( card : { component : React . ComponentType } ) => {
221+ register : ( card : {
222+ component : React . ComponentType < {
223+ community ?: { id : string ; name : string } ;
224+ } > ;
225+ } ) => {
208226 Component = card . component ;
209227 } ,
210228 } ,
211229 } as unknown as Parameters < PluginModule [ "apply" ] > [ 0 ] ) ;
212- render ( < Component /> ) ;
230+ render ( < Component community = { { id : "primary" , name : "Primary" } } /> ) ;
213231 await screen . findByText ( "Running" ) ;
214232 expect ( screen . queryByText ( "Connected" ) ) . not . toBeInTheDocument ( ) ;
215233 expect ( screen . getByRole ( "button" , { name : "Disconnect" } ) ) . toBeEnabled ( ) ;
@@ -242,22 +260,28 @@ it("polls transient states serially, stops at Running, and cancels on unmount",
242260 viewer : "viewer" ,
243261 scope : "https://fixture.example:viewer" ,
244262 } ;
245- let Component ! : React . ComponentType ;
263+ let Component ! : React . ComponentType < {
264+ community ?: { id : string ; name : string } ;
265+ } > ;
246266 let dispose ! : ( ) => void ;
247267 apply ( {
248268 relay : { snapshot : ( ) => snapshot , subscribe : ( ) => ( ) => { } } ,
249269 effect : ( setup : ( ) => ( ) => void ) => {
250270 dispose = setup ( ) ;
251271 } ,
252272 settingsCards : {
253- register : ( page : { component : React . ComponentType } ) => {
273+ register : ( page : {
274+ component : React . ComponentType < {
275+ community ?: { id : string ; name : string } ;
276+ } > ;
277+ } ) => {
254278 Component = page . component ;
255279 } ,
256280 } ,
257281 } as unknown as Parameters < PluginModule [ "apply" ] > [ 0 ] ) ;
258282 try {
259283 await act ( async ( ) => {
260- render ( < Component /> ) ;
284+ render ( < Component community = { { id : "primary" , name : "Primary" } } /> ) ;
261285 } ) ;
262286 expect ( screen . getByRole ( "status" ) ) . toHaveTextContent ( "Starting…" ) ;
263287 await act ( async ( ) => {
0 commit comments