Skip to content

Commit 8ea6f91

Browse files
author
p_doub
committed
add test for span core component
1 parent 8716b07 commit 8ea6f91

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

spec/usage/components/span_spec.rb

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
require_relative "../../support/utils"
2+
include Utils
3+
4+
describe 'Span Component', type: :feature, js: true do
5+
6+
it 'Example 1' do
7+
8+
class ExamplePage < Page::Cell::Page
9+
10+
def response
11+
components {
12+
# simple span
13+
span do
14+
plain 'I am simple'
15+
end
16+
17+
# enhanced span
18+
span id: 'my-id', class: 'my-class' do
19+
plain 'I am enhanced'
20+
end
21+
}
22+
end
23+
24+
end
25+
26+
visit '/example'
27+
28+
static_output = page.html
29+
30+
expected_static_output = <<~HTML
31+
<span>I am simple</span>
32+
<span id="my-id" class="my-class">I am enhanced</span>
33+
HTML
34+
35+
expect(stripped(static_output)).to include(stripped(expected_static_output))
36+
end
37+
38+
end

0 commit comments

Comments
 (0)