Skip to content

Commit 5b68af8

Browse files
author
p_doub
committed
add icon component test
1 parent b5d6c7f commit 5b68af8

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

spec/usage/components/icon_spec.rb

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
require_relative '../../support/utils'
2+
include Utils
3+
4+
describe 'Icon 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+
# using the icon tag as italic styling
13+
icon text: 'I am italic text'
14+
15+
# Fontawesome icon tag without options[:text]
16+
icon class: 'fab fa-500px'
17+
18+
# MDL icon without options[:text]
19+
icon class: 'material-icons' do
20+
plain 'accessibility'
21+
end
22+
23+
# MDL icon with options[:text] (recommended)
24+
icon class: 'material-icons', text: 'check_circle'
25+
}
26+
end
27+
28+
end
29+
30+
visit "/example"
31+
32+
static_output = page.html
33+
34+
expected_static_output = <<~HTML
35+
<i>I am italic text</i>
36+
<i class="fab fa-500px"></i>
37+
<i class="material-icons">
38+
accessibility
39+
</i>
40+
<i class="material-icons">
41+
check_circle
42+
</i>
43+
HTML
44+
45+
expect(stripped(static_output)).to include(stripped(expected_static_output))
46+
end
47+
48+
end

0 commit comments

Comments
 (0)