@@ -17,7 +17,7 @@ import type {
1717 TestRunDetail
1818} from './types.js'
1919import { TestState } from './types.js'
20- import { DEFAULT_CAPABILITIES , FRAMEWORK_CAPABILITIES } from './constants.js'
20+ import { DEFAULT_CAPABILITIES , FRAMEWORK_CAPABILITIES , STATE_MAP } from './constants.js'
2121
2222import '~icons/mdi/play.js'
2323import '~icons/mdi/stop.js'
@@ -31,13 +31,6 @@ import type { DevtoolsSidebarFilter } from './filter.js'
3131
3232const EXPLORER = 'wdio-devtools-sidebar-explorer'
3333
34- const STATE_MAP : Record < string , TestState > = {
35- 'running' : TestState . RUNNING ,
36- 'failed' : TestState . FAILED ,
37- 'passed' : TestState . PASSED ,
38- 'skipped' : TestState . SKIPPED
39- }
40-
4134@customElement ( EXPLORER )
4235export class DevtoolsSidebarExplorer extends CollapseableEntry {
4336 #testFilter: DevtoolsSidebarFilter | undefined
@@ -376,12 +369,18 @@ export class DevtoolsSidebarExplorer extends CollapseableEntry {
376369
377370 // Check explicit state first
378371 const mappedState = STATE_MAP [ state ]
379- if ( mappedState ) return mappedState
372+ if ( mappedState ) {
373+ return mappedState
374+ }
380375
381376 // For suites, compute state from children
382377 if ( 'tests' in entry ) {
383- if ( this . #isRunning( entry ) ) return TestState . RUNNING
384- if ( this . #hasFailed( entry ) ) return TestState . FAILED
378+ if ( this . #isRunning( entry ) ) {
379+ return TestState . RUNNING
380+ }
381+ if ( this . #hasFailed( entry ) ) {
382+ return TestState . FAILED
383+ }
385384 return TestState . PASSED
386385 }
387386
@@ -480,8 +479,7 @@ export class DevtoolsSidebarExplorer extends CollapseableEntry {
480479 < p class ="text-disabledForeground "> No tests to display</ p >
481480 < p class ="text-xs text-disabledForeground mt-2 ">
482481 Debug: suites=${ this . suites ?. length || 0 } ,
483- rootSuites=${ uniqueSuites . length } ,
484- filtered=${ suites . length }
482+ rootSuites=${ uniqueSuites . length } , filtered=${ suites . length }
485483 </ p >
486484 </ div > ` }
487485 </ wdio-test-suite >
0 commit comments