@@ -21,12 +21,18 @@ test.describe('sessions page', () => {
2121 test ( 'session list shows an IP address or device info' , async ( { authedPage } ) => {
2222 await authedPage . goto ( '/settings/sessions' ) ;
2323 await authedPage . waitForLoadState ( 'networkidle' ) ;
24- // IP addresses or user-agent info should be visible in the session list
25- await expect ( authedPage . locator ( 'td, [data-ip], [data-agent]' ) . first ( ) )
26- . toBeVisible ( { timeout : 5000 } )
27- . catch ( ( ) => {
28- // May use a different layout
24+ // The current session must be identifiable — assert either layout-cell info
25+ // or a recognizable IPv4 pattern is present somewhere on the page.
26+ const cellVisible = await authedPage
27+ . locator ( 'td, [data-ip], [data-agent]' )
28+ . first ( )
29+ . isVisible ( { timeout : 5000 } )
30+ . catch ( ( ) => false ) ;
31+ if ( ! cellVisible ) {
32+ await expect ( authedPage . getByText ( / \b \d { 1 , 3 } ( \. \d { 1 , 3 } ) { 3 } \b / ) . first ( ) ) . toBeVisible ( {
33+ timeout : 5000 ,
2934 } ) ;
35+ }
3036 } ) ;
3137} ) ;
3238
@@ -37,14 +43,20 @@ test.describe('connections / OAuth page', () => {
3743 await expect ( authedPage . locator ( 'main' ) . first ( ) ) . toBeVisible ( ) ;
3844 } ) ;
3945
40- test ( 'shows available OAuth providers' , async ( { authedPage } ) => {
46+ test ( 'shows available OAuth providers or an empty state ' , async ( { authedPage } ) => {
4147 await authedPage . goto ( '/settings/connections' ) ;
4248 await authedPage . waitForLoadState ( 'networkidle' ) ;
43- // Should list at least one OAuth provider (e.g. Discord, GitHub, Google)
44- await expect ( authedPage . getByText ( / d i s c o r d | g i t h u b | g o o g l e | o a u t h | p r o v i d e r / i) . first ( ) )
45- . toBeVisible ( { timeout : 5000 } )
46- . catch ( ( ) => {
47- // Page might not have any OAuth providers configured on dev backend
48- } ) ;
49+ // Either provider UI is present, or an empty/none-configured state is shown.
50+ // Both are acceptable — what's not acceptable is rendering nothing at all.
51+ const providerVisible = await authedPage
52+ . getByText ( / d i s c o r d | g i t h u b | g o o g l e | o a u t h | p r o v i d e r / i)
53+ . first ( )
54+ . isVisible ( { timeout : 5000 } )
55+ . catch ( ( ) => false ) ;
56+ if ( ! providerVisible ) {
57+ await expect (
58+ authedPage . getByText ( / n o .* ( p r o v i d e r | c o n n e c t i o n | c o n f i g u r e d ) | n o n e \s * ( a v a i l a b l e | c o n f i g u r e d ) / i) . first ( )
59+ ) . toBeVisible ( { timeout : 5000 } ) ;
60+ }
4961 } ) ;
5062} ) ;
0 commit comments