@@ -3,7 +3,7 @@ import { html, css, nothing, type TemplateResult } from 'lit'
33import { customElement } from 'lit/decorators.js'
44import { consume } from '@lit/context'
55import type { TestStats , SuiteStats } from '@wdio/reporter'
6- import { repeat } from 'lit/directives/repeat.js'
6+
77import { TestState } from './test-suite.js'
88import { suiteContext } from '../../controller/DataManager.js'
99
@@ -20,7 +20,6 @@ import type { DevtoolsSidebarFilter } from './filter.js'
2020const EXPLORER = 'wdio-devtools-sidebar-explorer'
2121
2222interface TestEntry {
23- uid : string
2423 state ?: string
2524 label : string
2625 children : TestEntry [ ]
@@ -33,21 +32,7 @@ export class DevtoolsSidebarExplorer extends CollapseableEntry {
3332 static styles = [ ...Element . styles , css `
3433 :host {
3534 width: 100%;
36- display: flex;
37- flex-direction: column;
38- min-height: 0;
39- }
40-
41- header {
42- flex: 0 0 auto;
43- }
44-
45- wdio-test-suite {
46- flex: 1 1 auto;
47- overflow-y: auto;
48- overflow-x: hidden;
49- min-height: 0;
50- scrollbar-width: none;
35+ display: block;
5136 }
5237 ` ]
5338
@@ -68,16 +53,10 @@ export class DevtoolsSidebarExplorer extends CollapseableEntry {
6853 return html `
6954 < wdio-test-entry state ="${ entry . state as any } ">
7055 < label slot ="label "> ${ entry . label } </ label >
71- ${ entry . children && entry . children . length
72- ? html `
73- < wdio-test-suite slot ="children ">
74- ${ repeat (
75- entry . children ,
76- child => child . uid ,
77- child => this . #renderEntry( child )
78- ) }
79- </ wdio-test-suite >
80- `
56+ ${ entry . children && entry . children . length ?
57+ html `
58+ < wdio-test-suite slot ="children "> ${ entry . children . map ( this . #renderEntry. bind ( this ) ) } </ wdio-test-suite >
59+ `
8160 : nothing
8261 }
8362 </ wdio-test-entry >
@@ -109,7 +88,6 @@ export class DevtoolsSidebarExplorer extends CollapseableEntry {
10988 if ( 'tests' in entry ) {
11089 const entries = [ ...entry . tests , ...entry . suites ]
11190 return {
112- uid : entry . uid ,
11391 label : entry . title ,
11492 state : entry . tests . some ( ( t ) => ! t . end )
11593 ? TestState . RUNNING
@@ -122,7 +100,6 @@ export class DevtoolsSidebarExplorer extends CollapseableEntry {
122100 }
123101 }
124102 return {
125- uid : entry . uid ,
126103 label : entry . title ,
127104 state : ! entry . end
128105 ? TestState . RUNNING
@@ -137,18 +114,7 @@ export class DevtoolsSidebarExplorer extends CollapseableEntry {
137114 if ( ! this . suites ) {
138115 return
139116 }
140-
141- // ✅ Only root suites (no parent = true top-level suite)
142- const rootSuites = this . suites
143- . flatMap ( s => Object . values ( s ) )
144- . filter ( suite => ! suite . parent )
145-
146- // Deduplicate by uid (in case some frameworks still push duplicates)
147- const uniqueSuites = Array . from (
148- new Map ( rootSuites . map ( suite => [ suite . uid , suite ] ) ) . values ( )
149- )
150-
151- const suites = uniqueSuites
117+ const suites = Object . values ( this . suites [ 0 ] )
152118 . map ( this . #getTestEntry. bind ( this ) )
153119 . filter ( this . #filterEntry. bind ( this ) )
154120
@@ -166,11 +132,7 @@ export class DevtoolsSidebarExplorer extends CollapseableEntry {
166132 </ header >
167133 < wdio-test-suite >
168134 ${ suites . length
169- ? repeat (
170- suites ,
171- suite => suite . uid ,
172- suite => this . #renderEntry( suite )
173- )
135+ ? suites . map ( this . #renderEntry. bind ( this ) )
174136 : html `< p class ="text-disabledForeground text-sm px-4 py-2 "> No tests found</ p > `
175137 }
176138 </ wdio-test-suite >
0 commit comments