@@ -22,23 +22,25 @@ describe('details-dialog-element', function() {
22
22
beforeEach ( function ( ) {
23
23
const container = document . createElement ( 'div' )
24
24
container . innerHTML = `
25
- <details>
26
- <summary>Click</summary>
27
- <details-dialog>
28
- <p>Hello</p>
29
- <button data-button>Button</button>
30
- <button hidden>hidden</button>
31
- <div hidden><button>hidden</button></div>
32
- <details><button>Button in closed details</button></details>
33
- <button ${ CLOSE_ATTR } >Goodbye</button>
34
- </details-dialog>
25
+ <details open>
26
+ <details id="details">
27
+ <summary id="summary">Click</summary>
28
+ <details-dialog>
29
+ <p>Hello</p>
30
+ <button data-button>Button</button>
31
+ <button hidden>hidden</button>
32
+ <div hidden><button>hidden</button></div>
33
+ <details><button>Button in closed details</button></details>
34
+ <button ${ CLOSE_ATTR } >Goodbye</button>
35
+ </details-dialog>
36
+ </details>
35
37
</details>
36
38
`
37
39
document . body . append ( container )
38
40
39
- details = document . querySelector ( 'details' )
41
+ details = document . querySelector ( '# details' )
40
42
dialog = details . querySelector ( 'details-dialog' )
41
- summary = details . querySelector ( 'summary' )
43
+ summary = details . querySelector ( '# summary' )
42
44
close = dialog . querySelector ( CLOSE_SELECTOR )
43
45
} )
44
46
@@ -135,6 +137,11 @@ describe('details-dialog-element', function() {
135
137
allowCloseToHappen = true
136
138
close . click ( )
137
139
assert ( ! details . open )
140
+ assert . equal ( closeRequestCount , 5 )
141
+
142
+ summary . click ( )
143
+ assert ( details . open )
144
+ assert . equal ( closeRequestCount , 5 )
138
145
} )
139
146
140
147
describe ( 'when no summary element is present' , function ( ) {
0 commit comments