File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ require_relative "../../support/utils"
2
+ include Utils
3
+
4
+ describe 'Details Element with summary' , type : :feature , js : true do
5
+ it 'Example 1' do
6
+ class ExamplePage < Page ::Cell ::Page
7
+ def response
8
+ components {
9
+ # basic
10
+ details do
11
+ summary text : 'Hello'
12
+ pg text : 'World!'
13
+ end
14
+
15
+ # enhanced
16
+ details id : 'detail_id' , class : 'detail_class' do
17
+ summary id : 'summary_id' , class : 'summary_class' , text : 'Hello'
18
+ pg text : 'World!'
19
+ end
20
+ }
21
+ end
22
+ end
23
+ visit '/example'
24
+
25
+ static_output = page . html
26
+
27
+ expected_static_output = <<~HTML
28
+ < details class ="detail_class " id ="detail_id ">
29
+ < summary id ="summary_id " class ="summary_class "> Hello</ summary >
30
+ < p > World!</ p >
31
+ </ details >
32
+ HTML
33
+
34
+ expect ( stripped ( static_output ) ) . to include ( stripped ( expected_static_output ) )
35
+ end
36
+ end
You can’t perform that action at this time.
0 commit comments