@@ -147,10 +147,10 @@ export async function acceptConsentAndInitialize(page, options = {}) {
147147 page . off ( 'console' , consoleListener ) ;
148148
149149 console . log ( '✅ Consent accepted' ) ;
150-
150+
151151 // Handle WebAuthn setup modal (if it appears)
152152 await handleWebAuthnModal ( page ) ;
153-
153+
154154 console . log ( '✅ P2P initialization started' ) ;
155155}
156156
@@ -165,7 +165,7 @@ export async function waitForP2PInitialization(page, timeout = 30000) {
165165
166166 // Wait for todo input to be available (indicates OrbitDB is ready)
167167 await page . waitForSelector ( '[data-testid="todo-input"]' , { timeout : 10000 } ) ;
168-
168+
169169 // Wait for footer to be displayed (indicates successful P2P initialization)
170170 // The footer appears when initializationStore.isInitialized is true
171171 await page . waitForSelector ( 'footer' , { timeout, state : 'visible' } ) ;
@@ -188,33 +188,33 @@ export async function waitForPeerCount(page, minPeers = 1, timeout = 60000) {
188188 const debugInfo = await page . evaluate ( ( ) => {
189189 const footer = document . querySelector ( 'footer' ) ;
190190 if ( ! footer ) return { hasFooter : false } ;
191-
191+
192192 const peersLabel = Array . from ( footer . querySelectorAll ( 'span' ) ) . find ( ( s ) =>
193193 s . textContent ?. includes ( 'Peers:' )
194194 ) ;
195195 if ( ! peersLabel ) return { hasFooter : true , hasPeersLabel : false } ;
196-
196+
197197 const countSpan = peersLabel . nextElementSibling ;
198198 if ( ! countSpan ) return { hasFooter : true , hasPeersLabel : true , hasCountSpan : false } ;
199-
199+
200200 const countText = countSpan . textContent ;
201201 const match = countText ?. match ( / \( ( \d + ) \) / ) ;
202202 const count = match ? parseInt ( match [ 1 ] , 10 ) : 0 ;
203-
203+
204204 // Also check libp2p peers directly
205205 let libp2pPeerCount = 0 ;
206206 if ( window . __libp2p__ ) {
207207 try {
208208 libp2pPeerCount = window . __libp2p__ . getPeers ( ) ?. length || 0 ;
209- } catch ( e ) {
209+ } catch {
210210 // ignore
211211 }
212212 }
213-
214- return {
215- hasFooter : true ,
216- hasPeersLabel : true ,
217- hasCountSpan : true ,
213+
214+ return {
215+ hasFooter : true ,
216+ hasPeersLabel : true ,
217+ hasCountSpan : true ,
218218 countText,
219219 count,
220220 libp2pPeerCount
@@ -306,12 +306,12 @@ export async function getPeerId(page) {
306306 // The footer shows "...xxxxx" (last 5 chars), but we need the full ID
307307 // For now, return what we have - tests will need to be updated
308308 const shortId = peerIdCode . textContent ?. trim ( ) ;
309-
309+
310310 // Try to get full peer ID from window object if available
311311 if ( window . __libp2p__ && window . __libp2p__ . peerId ) {
312312 return window . __libp2p__ . peerId . toString ( ) ;
313313 }
314-
314+
315315 return shortId || null ;
316316 } ) ;
317317}
@@ -325,7 +325,7 @@ export async function getPeerId(page) {
325325export async function getConnectedPeerIds ( page ) {
326326 return await page . evaluate ( ( ) => {
327327 const peers = [ ] ;
328-
328+
329329 // Try to get peers from libp2p instance if available
330330 if ( window . __libp2p__ ) {
331331 try {
@@ -334,11 +334,11 @@ export async function getConnectedPeerIds(page) {
334334 peers . push ( peerId . toString ( ) ) ;
335335 } ) ;
336336 return peers ;
337- } catch ( e ) {
337+ } catch {
338338 // Fall through to footer method
339339 }
340340 }
341-
341+
342342 // Fallback: try to get from footer hover (won't work without hover)
343343 // This is a limitation - we may need to expose peer IDs differently
344344 return peers ;
@@ -635,7 +635,7 @@ export async function handleWebAuthnModal(page, timeout = 5000) {
635635 timeout : 5000
636636 } ) ;
637637 console . log ( '✅ WebAuthn modal dismissed' ) ;
638- } catch ( error ) {
638+ } catch {
639639 // Modal didn't appear - this is fine, it might not show in all scenarios
640640 console . log ( 'ℹ️ WebAuthn modal did not appear (expected in many cases)' ) ;
641641 }
0 commit comments