File tree Expand file tree Collapse file tree 4 files changed +83
-0
lines changed
app/concepts/matestack/ui/core/aside Expand file tree Collapse file tree 4 files changed +83
-0
lines changed Original file line number Diff line number Diff line change
1
+ %aside {@tag_attributes}
2
+ - if block_given?
3
+ = yield
Original file line number Diff line number Diff line change
1
+ module Matestack ::Ui ::Core ::Aside
2
+ class Aside < Matestack ::Ui ::Core ::Component ::Static
3
+
4
+ end
5
+ end
Original file line number Diff line number Diff line change
1
+ # matestack core component: Aside
2
+
3
+ Show [ specs] ( /spec/usage/components/aside_spec.rb )
4
+
5
+ The HTML ` <aside> ` tag implemented in ruby.
6
+
7
+ ## Parameters
8
+
9
+ This component can take 2 optional configuration params and optional content.
10
+
11
+ #### # id (optional)
12
+ Expects a string with all ids the aside tag should have.
13
+
14
+ #### # class (optional)
15
+ Expects a string with all classes the aside tag should have.
16
+
17
+ ## Example 1
18
+
19
+ ``` ruby
20
+ aside id: " foo" , class : " bar" do
21
+ paragraph text: " This is some text"
22
+ end
23
+ ```
24
+
25
+ returns
26
+
27
+ ``` html
28
+ <aside id =" foo" class =" bar" >
29
+ <p >This is some text</p >
30
+ </aside >
31
+ ```
Original file line number Diff line number Diff line change
1
+ require_relative "../../support/utils"
2
+ include Utils
3
+
4
+ describe "Aside Component" , type : :feature , js : true do
5
+ it "Example 1" do
6
+ class ExamplePage < Matestack ::Ui ::Page
7
+
8
+ def response
9
+ components {
10
+ #simple aside
11
+ aside
12
+
13
+ #simple aside with attributes
14
+ aside id : "my-id" , class : "my-class"
15
+
16
+ #nested aside
17
+ aside do
18
+ paragraph text : "This is some text"
19
+ end
20
+ }
21
+ end
22
+
23
+ end
24
+
25
+ visit "/example"
26
+
27
+ static_output = page . html
28
+
29
+ expected_static_output = <<~HTML
30
+ < aside > </ aside >
31
+
32
+ < aside id ="my-id " class ="my-class "> </ aside >
33
+
34
+ < aside >
35
+ < p > This is some text</ p >
36
+ </ aside >
37
+ HTML
38
+
39
+ expect ( stripped ( static_output ) ) . to include ( stripped ( expected_static_output ) )
40
+ end
41
+
42
+ end
43
+
44
+
You can’t perform that action at this time.
0 commit comments