File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,9 +47,16 @@ const getAuxillaryData = buildGetAuxillaryDataRoute({
4747 } ) ;
4848
4949 // Prefer post-validation connection row (may include regeneration diagnostics).
50- const refreshedConnection = valid
51- ? ( await manager . getConnection ( userId , 'github' ) . catch ( ( ) => null ) ) || connection
52- : ( await manager . getConnection ( userId , 'github' ) . catch ( ( ) => null ) ) || connection ;
50+ // getConnection is optional on lightweight managers in tests — never throw.
51+ let refreshedConnection = connection ;
52+ try {
53+ if ( manager && typeof manager . getConnection === 'function' ) {
54+ refreshedConnection =
55+ ( await manager . getConnection ( userId , 'github' ) ) || connection ;
56+ }
57+ } catch {
58+ refreshedConnection = connection ;
59+ }
5360
5461 return {
5562 repositoryConnectionStatus : buildStoredConnectionStatus (
Original file line number Diff line number Diff line change @@ -55,7 +55,10 @@ describe("VCSConnectionCard — regeneration-failure diagnostic (V48-Gate3-F34)"
5555 screen . getByText ( / F a i l e d t o g e n e r a t e i n s t a l l a t i o n t o k e n : 4 0 4 N o t F o u n d / i) ,
5656 ) . toBeInTheDocument ( ) ;
5757 expect (
58- screen . getByText ( / T r y D i s c o n n e c t b e l o w , t h e n r e c o n n e c t / i) ,
58+ screen . getByText ( / b i t c o d e - g i t h u b - a u x i l i a r y / i) ,
59+ ) . toBeInTheDocument ( ) ;
60+ expect (
61+ screen . getByText ( / T r y D i s c o n n e c t , t h e n I n s t a l l G i t H u b A p p a g a i n / i) ,
5962 ) . toBeInTheDocument ( ) ;
6063 } ) ;
6164
@@ -76,7 +79,7 @@ describe("VCSConnectionCard — regeneration-failure diagnostic (V48-Gate3-F34)"
7679 screen . getByText ( / G i t H u b A p p c r e d e n t i a l s a r e n o t c o n f i g u r e d / i) ,
7780 ) . toBeInTheDocument ( ) ;
7881 expect (
79- screen . queryByText ( / T r y D i s c o n n e c t b e l o w , t h e n r e c o n n e c t / i) ,
82+ screen . queryByText ( / T r y D i s c o n n e c t , t h e n I n s t a l l G i t H u b A p p a g a i n / i) ,
8083 ) . not . toBeInTheDocument ( ) ;
8184 } ) ;
8285
You can’t perform that action at this time.
0 commit comments