ui_bibz 3.0.0.alpha8 → 3.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -0
- data/Gemfile.lock +19 -16
- data/README.md +5 -1
- data/lib/ui_bibz/concerns/models/searchable.rb +1 -1
- data/lib/ui_bibz/infos.rb +4 -4
- data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_text_field_input.rb +1 -1
- data/lib/ui_bibz/ui/concerns/html_concern.rb +8 -2
- data/lib/ui_bibz/ui/core/boxes/components/card_body.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/components/card_image.rb +5 -1
- data/lib/ui_bibz/ui/core/forms/buttons/button.rb +5 -14
- data/lib/ui_bibz/ui/core/forms/buttons/button_link.rb +2 -3
- data/lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb +0 -1
- data/lib/ui_bibz/ui/core/forms/dropdowns/dropdown.rb +5 -3
- data/lib/ui_bibz/ui/core/forms/dropdowns/split_dropdown.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/numbers/formula_field.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/numbers/slider_header.rb +2 -2
- data/lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb +35 -5
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button.rb +1 -7
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_link.rb +1 -7
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_dropdown.rb +5 -4
- data/lib/ui_bibz/ui/core/icons/glyph.rb +9 -1
- data/lib/ui_bibz/ui/core/lists/list_group.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/components/nav_dropdown.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/components/nav_link_link.rb +2 -2
- data/lib/ui_bibz/ui/core/navigations/components/nav_link_span.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/components/nav_text.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/link.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/nav.rb +3 -3
- data/lib/ui_bibz/ui/core/navigations/navbar.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/tab_group.rb +5 -1
- data/lib/ui_bibz/ui/core/notifications/components/alert_header.rb +1 -1
- data/lib/ui_bibz/ui/core/notifications/components/toast_header.rb +16 -2
- data/lib/ui_bibz/ui/core/notifications/toast.rb +1 -1
- data/lib/ui_bibz/ui/core/windows/components/modal_header.rb +1 -1
- data/lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb +9 -24
- data/lib/ui_bibz/ui/extensions/core/component/popover_extension.rb +7 -7
- data/lib/ui_bibz/ui/ux/tables/table_search_field.rb +1 -1
- data/test/simple_form_test.rb +5 -5
- data/test/ui/core/boxes/card_test.rb +2 -2
- data/test/ui/core/component_test.rb +2 -2
- data/test/ui/core/forms/buttons/button_group_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_link_test.rb +2 -9
- data/test/ui/core/forms/buttons/button_refresh_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_test.rb +8 -15
- data/test/ui/core/forms/choices/choice_group_test.rb +3 -3
- data/test/ui/core/forms/dropdowns/dropdown_test.rb +5 -5
- data/test/ui/core/forms/numbers/formula_field_test.rb +1 -1
- data/test/ui/core/forms/selects/multi_select_field_test.rb +3 -3
- data/test/ui/core/forms/selects/select_field_test.rb +1 -1
- data/test/ui/core/forms/surrounds/surround_field_test.rb +2 -2
- data/test/ui/core/forms/texts/auto_complete_field_test.rb +2 -2
- data/test/ui/core/lists/list_group_test.rb +1 -1
- data/test/ui/core/navigations/breadcrumb_test.rb +1 -1
- data/test/ui/core/navigations/link_test.rb +2 -2
- data/test/ui/core/navigations/nav_test.rb +2 -2
- data/test/ui/core/navigations/navbar_test.rb +4 -4
- data/test/ui/core/navigations/tab_group_test.rb +5 -5
- data/test/ui/core/notifications/alert_test.rb +1 -1
- data/test/ui/core/notifications/badge_test.rb +2 -2
- data/test/ui/core/notifications/toast_test.rb +1 -1
- data/test/ui/core/windows/modal_test.rb +2 -2
- data/test/ui/ux/containers/panel_test.rb +1 -1
- data/test/ui/ux/tables/table_test.rb +2 -2
- data/ui_bibz.gemspec +2 -1
- metadata +20 -6
@@ -54,13 +54,6 @@ class ButtonLinkTest < ActionView::TestCase
|
|
54
54
|
assert_equal expected, actual
|
55
55
|
end
|
56
56
|
|
57
|
-
test 'button_link block' do
|
58
|
-
actual = ui_button_link('state', type: :block)
|
59
|
-
expected = '<a class="btn-secondary btn btn-block" role="button" href="#">state</a>'
|
60
|
-
|
61
|
-
assert_equal expected, actual
|
62
|
-
end
|
63
|
-
|
64
57
|
test 'button_link size' do
|
65
58
|
actual = ui_button_link('state', size: :sm)
|
66
59
|
expected = '<a class="btn-secondary btn btn-sm" role="button" href="#">state</a>'
|
@@ -70,14 +63,14 @@ class ButtonLinkTest < ActionView::TestCase
|
|
70
63
|
|
71
64
|
test 'button_link toggle' do
|
72
65
|
actual = ui_button_link('state', toggle: true)
|
73
|
-
expected = '<a class="btn-secondary btn" data-toggle="button" aria-pressed="false" autocomplete="off" role="button" href="#">state</a>'
|
66
|
+
expected = '<a class="btn-secondary btn" data-bs-toggle="button" aria-pressed="false" autocomplete="off" role="button" href="#">state</a>'
|
74
67
|
|
75
68
|
assert_equal expected, actual
|
76
69
|
end
|
77
70
|
|
78
71
|
test 'button_link glyph' do
|
79
72
|
actual = ui_button_link('state', glyph: 'diamond')
|
80
|
-
expected = '<a class="btn-secondary btn" role="button" href="#"><i class="glyph fas fa-diamond"></i>
|
73
|
+
expected = '<a class="btn-secondary btn" role="button" href="#"><i class="glyph fas fa-diamond"></i> state</a>'
|
81
74
|
|
82
75
|
assert_equal expected, actual
|
83
76
|
end
|
@@ -5,7 +5,7 @@ require 'test_helper'
|
|
5
5
|
class ButtonRefreshTest < ActionView::TestCase
|
6
6
|
test 'button' do
|
7
7
|
actual = UiBibz::Ui::Core::Forms::Buttons::ButtonRefresh.new('state', status: :success, connect: { target: { url: '/' } }).render
|
8
|
-
expected =
|
8
|
+
expected = "<span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"","url":"/","data":[]}}\" class=\"btn-success ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i> state</span>"
|
9
9
|
|
10
10
|
assert_equal expected, actual
|
11
11
|
end
|
@@ -47,13 +47,6 @@ class ButtonTest < ActionView::TestCase
|
|
47
47
|
assert_equal expected, actual
|
48
48
|
end
|
49
49
|
|
50
|
-
test 'button block' do
|
51
|
-
actual = ui_button('state', type: :block)
|
52
|
-
expected = '<button class="btn-secondary btn btn-block">state</button>'
|
53
|
-
|
54
|
-
assert_equal expected, actual
|
55
|
-
end
|
56
|
-
|
57
50
|
test 'button size' do
|
58
51
|
actual = ui_button('state', size: :sm)
|
59
52
|
expected = '<button class="btn-secondary btn btn-sm">state</button>'
|
@@ -63,56 +56,56 @@ class ButtonTest < ActionView::TestCase
|
|
63
56
|
|
64
57
|
test 'button toggle' do
|
65
58
|
actual = ui_button('state', toggle: true)
|
66
|
-
expected = '<button class="btn-secondary btn" data-toggle="button" aria-pressed="false" autocomplete="off">state</button>'
|
59
|
+
expected = '<button class="btn-secondary btn" data-bs-toggle="button" aria-pressed="false" autocomplete="off">state</button>'
|
67
60
|
|
68
61
|
assert_equal expected, actual
|
69
62
|
end
|
70
63
|
|
71
64
|
test 'button glyph' do
|
72
65
|
actual = ui_button('state', glyph: 'diamond')
|
73
|
-
expected =
|
66
|
+
expected = "<button class=\"btn-secondary btn\"><i class=\"glyph fas fa-diamond\"></i> state</button>"
|
74
67
|
|
75
68
|
assert_equal expected, actual
|
76
69
|
end
|
77
70
|
|
78
71
|
test 'button glyph without text' do
|
79
72
|
actual = ui_button('state', glyph: 'diamond', text: false)
|
80
|
-
expected =
|
73
|
+
expected = "<button class=\"btn-secondary btn\"><i class=\"glyph fas fa-diamond\"></i> <span class=\"visually-hidden\">state</span></button>"
|
81
74
|
|
82
75
|
assert_equal expected, actual
|
83
76
|
end
|
84
77
|
|
85
78
|
test 'button with collapse' do
|
86
79
|
actual = ui_button('state', collapse: 'collapse-id')
|
87
|
-
expected = '<button class="btn-secondary btn" data-toggle="collapse" data-target="#collapse-id" aria-controls="collapse-id" aria-expanded="false">state</button>'
|
80
|
+
expected = '<button class="btn-secondary btn" data-bs-toggle="collapse" data-bs-target="#collapse-id" aria-controls="collapse-id" aria-expanded="false">state</button>'
|
88
81
|
|
89
82
|
assert_equal expected, actual
|
90
83
|
end
|
91
84
|
|
92
85
|
test 'button with simple popover' do
|
93
86
|
actual = ui_button('My Button', popover: 'My popover')
|
94
|
-
expected = '<button data-toggle="popover" data-content="My popover" class="btn-secondary btn">My Button</button>'
|
87
|
+
expected = '<button data-bs-toggle="popover" data-bs-content="My popover" class="btn-secondary btn">My Button</button>'
|
95
88
|
|
96
89
|
assert_equal expected, actual
|
97
90
|
end
|
98
91
|
|
99
92
|
test 'button with complex popover' do
|
100
93
|
actual = ui_button('My Button', popover: { content: 'My popover', position: :left })
|
101
|
-
expected = '<button data-toggle="popover" data-content="My popover" data-placement="left" class="btn-secondary btn">My Button</button>'
|
94
|
+
expected = '<button data-bs-toggle="popover" data-bs-content="My popover" data-bs-placement="left" class="btn-secondary btn">My Button</button>'
|
102
95
|
|
103
96
|
assert_equal expected, actual
|
104
97
|
end
|
105
98
|
|
106
99
|
test 'button with simple tooltip' do
|
107
100
|
actual = ui_button('My Button', { tooltip: 'My Button' }, { title: 'My tooltip' })
|
108
|
-
expected = '<button title="My tooltip" data-toggle="tooltip" data-title="My Button" class="btn-secondary btn">My Button</button>'
|
101
|
+
expected = '<button title="My tooltip" data-bs-toggle="tooltip" data-title="My Button" class="btn-secondary btn">My Button</button>'
|
109
102
|
|
110
103
|
assert_equal expected, actual
|
111
104
|
end
|
112
105
|
|
113
106
|
test 'button with complex tooltip' do
|
114
107
|
actual = ui_button('My Button', tooltip: { title: 'My tooltip', position: :left })
|
115
|
-
expected = '<button data-toggle="tooltip" data-title="My tooltip" data-placement="left" class="btn-secondary btn">My Button</button>'
|
108
|
+
expected = '<button data-bs-toggle="tooltip" data-title="My tooltip" data-bs-placement="left" class="btn-secondary btn">My Button</button>'
|
116
109
|
|
117
110
|
assert_equal expected, actual
|
118
111
|
end
|
@@ -11,7 +11,7 @@ class ChoiceGroupTest < ActionView::TestCase
|
|
11
11
|
bc.choice 'Checkbox 2', state: :active
|
12
12
|
end
|
13
13
|
|
14
|
-
expected = "<div data-toggle=\"buttons\" class=\"btn-group button-choice btn-group-toggle\"><input type=\"checkbox\" autocomplete=\"off\" class=\"btn-check\" id=\"#{actual.items.first.input_options[:id]}\" /><label class=\"btn-secondary btn
|
14
|
+
expected = "<div data-toggle=\"buttons\" class=\"btn-group button-choice btn-group-toggle\"><input type=\"checkbox\" autocomplete=\"off\" class=\"btn-check\" id=\"#{actual.items.first.input_options[:id]}\" /><label class=\"btn-secondary btn\" for=\"#{actual.items.first.input_options[:id]}\">Checkbox 1</label><input type=\"checkbox\" autocomplete=\"off\" class=\"btn-check\" checked=\"checked\" id=\"#{actual.items.last.input_options[:id]}\" /><label class=\"active btn-secondary btn\" aria-pressed=\"true\" for=\"#{actual.items.last.input_options[:id]}\">Checkbox 2</label></div>"
|
15
15
|
|
16
16
|
assert_equal expected, actual.render
|
17
17
|
end
|
@@ -22,7 +22,7 @@ class ChoiceGroupTest < ActionView::TestCase
|
|
22
22
|
bc.choice 'Radio 2', state: :active
|
23
23
|
end
|
24
24
|
|
25
|
-
expected = "<div data-toggle=\"buttons\" class=\"btn-group button-choice btn-group-toggle\"><input type=\"radio\" autocomplete=\"off\" class=\"btn-check\" name=\"#{actual.items.first.input_options[:name]}\" id=\"#{actual.items.first.input_options[:id]}\" /><label class=\"btn-secondary btn
|
25
|
+
expected = "<div data-toggle=\"buttons\" class=\"btn-group button-choice btn-group-toggle\"><input type=\"radio\" autocomplete=\"off\" class=\"btn-check\" name=\"#{actual.items.first.input_options[:name]}\" id=\"#{actual.items.first.input_options[:id]}\" /><label class=\"btn-secondary btn\" for=\"#{actual.items.first.input_options[:id]}\">Radio 1</label><input type=\"radio\" autocomplete=\"off\" class=\"btn-check\" checked=\"checked\" name=\"#{actual.items.last.input_options[:name]}\" id=\"#{actual.items.last.input_options[:id]}\" /><label class=\"active btn-secondary btn\" aria-pressed=\"true\" for=\"#{actual.items.last.input_options[:id]}\">Radio 2</label></div>"
|
26
26
|
|
27
27
|
assert_equal expected, actual.render
|
28
28
|
end
|
@@ -32,7 +32,7 @@ class ChoiceGroupTest < ActionView::TestCase
|
|
32
32
|
bc.choice 'Radio 1', glyph: 'diamond', status: :primary
|
33
33
|
bc.choice 'Radio 2', state: :active
|
34
34
|
end
|
35
|
-
expected = "<div data-toggle=\"buttons\" class=\"btn-group btn-group-lg button-choice btn-group-toggle\"><input type=\"radio\" autocomplete=\"off\" class=\"btn-check\" name=\"#{actual.items.first.input_options[:name]}\" id=\"#{actual.items.first.input_options[:id]}\" /><label class=\"btn-outline-primary btn btn-lg
|
35
|
+
expected = "<div data-toggle=\"buttons\" class=\"btn-group btn-group-lg button-choice btn-group-toggle\"><input type=\"radio\" autocomplete=\"off\" class=\"btn-check\" name=\"#{actual.items.first.input_options[:name]}\" id=\"#{actual.items.first.input_options[:id]}\" /><label class=\"btn-outline-primary btn btn-lg\" for=\"#{actual.items.first.input_options[:id]}\"><i class=\"glyph fas fa-diamond\"></i> Radio 1</label><input type=\"radio\" autocomplete=\"off\" class=\"btn-check\" checked=\"checked\" name=\"#{actual.items.last.input_options[:name]}\" id=\"#{actual.items.last.input_options[:id]}\" /><label class=\"active btn-outline-secondary btn btn-lg\" aria-pressed=\"true\" for=\"#{actual.items.last.input_options[:id]}\">Radio 2</label></div>"
|
36
36
|
|
37
37
|
assert_equal expected, actual.render
|
38
38
|
end
|
@@ -8,7 +8,7 @@ class DropdownTest < ActionView::TestCase
|
|
8
8
|
actual = UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new('Dropdown').tap do |d|
|
9
9
|
d.link 'link'
|
10
10
|
end
|
11
|
-
expected = "<div class=\"dropdown\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"#{actual.id}\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#\">link</a></div></div>"
|
11
|
+
expected = "<div class=\"dropdown\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"#{actual.id}\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#\">link</a></div></div>"
|
12
12
|
|
13
13
|
assert_equal expected, actual.render
|
14
14
|
end
|
@@ -17,7 +17,7 @@ class DropdownTest < ActionView::TestCase
|
|
17
17
|
actual = UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new('Dropdown', status: :primary).tap do |d|
|
18
18
|
d.link 'link'
|
19
19
|
end
|
20
|
-
expected = "<div class=\"dropdown\"><button class=\"btn btn-primary dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"#{actual.id}\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#\">link</a></div></div>"
|
20
|
+
expected = "<div class=\"dropdown\"><button class=\"btn btn-primary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"#{actual.id}\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#\">link</a></div></div>"
|
21
21
|
|
22
22
|
assert_equal expected, actual.render
|
23
23
|
end
|
@@ -26,7 +26,7 @@ class DropdownTest < ActionView::TestCase
|
|
26
26
|
actual = UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new('Dropdown', status: :primary, outline: true).tap do |d|
|
27
27
|
d.link 'link'
|
28
28
|
end
|
29
|
-
expected = "<div class=\"dropdown\"><button class=\"btn btn-outline-primary dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"#{actual.id}\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#\">link</a></div></div>"
|
29
|
+
expected = "<div class=\"dropdown\"><button class=\"btn btn-outline-primary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"#{actual.id}\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#\">link</a></div></div>"
|
30
30
|
|
31
31
|
assert_equal expected, actual.render
|
32
32
|
end
|
@@ -39,7 +39,7 @@ class DropdownTest < ActionView::TestCase
|
|
39
39
|
d.divider
|
40
40
|
d.link 'Link3', url: '#link3'
|
41
41
|
end
|
42
|
-
expected = "<div class=\"dropup btn-group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"#{actual.id}\"><i class=\"glyph fas fa-diamond\"></i>
|
42
|
+
expected = "<div class=\"dropup btn-group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"#{actual.id}\"><i class=\"glyph fas fa-diamond\"></i> Dropdown</button><div class=\"dropdown-menu dropdown-menu-right\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#link1\"><i class=\"glyph fas fa-eye\"></i> Link 1</a><h6 class=\"dropdown-header\" role=\"presentation\">header</h6><a class=\"dropdown-item\" href=\"#link2\">Link 2</a><div class=\"dropdown-divider\"></div><a class=\"dropdown-item\" href=\"#link3\">Link3</a></div></div>"
|
43
43
|
|
44
44
|
assert_equal expected, actual.render
|
45
45
|
end
|
@@ -48,7 +48,7 @@ class DropdownTest < ActionView::TestCase
|
|
48
48
|
actual = UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new('Split Dropdown').tap do |d|
|
49
49
|
d.link 'state'
|
50
50
|
end
|
51
|
-
expected = "<div class=\"dropdown\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"#{actual.id}\">Split Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#\">state</a></div></div>"
|
51
|
+
expected = "<div class=\"dropdown\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"#{actual.id}\">Split Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#\">state</a></div></div>"
|
52
52
|
|
53
53
|
assert_equal expected, actual.render
|
54
54
|
end
|
@@ -5,7 +5,7 @@ require 'test_helper'
|
|
5
5
|
class FormulaFieldTest < ActionView::TestCase
|
6
6
|
test 'formula_field' do
|
7
7
|
actual = UiBibz::Ui::Core::Forms::Numbers::FormulaField.new('value').render
|
8
|
-
expected = '<div class="formula_field input-group ui_surround_field"><input type="text" name="value_formula" id="value_formula" class="formula-field form-control" /><span class="formula-field-sign input-group-text">=</span><input type="text" name="value" id="value" class="formula-field-result form-control" readonly="readonly" /><span data-toggle="tooltip" class="formula-field-alert input-group-text"><i class="glyph-danger glyph fas fa-exclamation-triangle"></i></span></div>'
|
8
|
+
expected = '<div class="formula_field input-group ui_surround_field"><input type="text" name="value_formula" id="value_formula" class="formula-field form-control" /><span class="formula-field-sign input-group-text">=</span><input type="text" name="value" id="value" class="formula-field-result form-control" readonly="readonly" /><span data-bs-toggle="tooltip" class="formula-field-alert input-group-text"><i class="glyph-danger glyph fas fa-exclamation-triangle"></i></span></div>'
|
9
9
|
|
10
10
|
assert_equal expected, actual
|
11
11
|
end
|
@@ -6,7 +6,7 @@ class DropdownSelectFieldTest < ActionView::TestCase
|
|
6
6
|
test 'Multi Select Field' do
|
7
7
|
options = options_for_select(Array.new(2) { |i| "option #{i}" })
|
8
8
|
actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('example', multiple: true, option_tags: options).render
|
9
|
-
expected = "<select name=\"example[]\" id=\"example\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"><option value=\"option 0\">option 0</option>
|
9
|
+
expected = "<select name=\"example[]\" id=\"example\" data-dropdown-classes=\"dropdown\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"><option value=\"option 0\">option 0</option>
|
10
10
|
<option value=\"option 1\">option 1</option></select>"
|
11
11
|
|
12
12
|
assert_equal expected, actual
|
@@ -15,7 +15,7 @@ class DropdownSelectFieldTest < ActionView::TestCase
|
|
15
15
|
test 'Multi Select Field data html options' do
|
16
16
|
grouped_options = { 'North America' => [['United statuss', 'US'], 'Canada'], 'Europe' => %w[Denmark Germany France] }
|
17
17
|
actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('example', { multiple: true, option_tags: grouped_options_for_select(grouped_options), clickable_opt_group: true, collapsible_opt_group: true, searchable: true, select_all_options: true, number_displayed: 2, status: :danger }).render
|
18
|
-
expected = "<select name=\"example[]\" id=\"example\" data-enable-clickable-opt-groups=\"true\" data-enable-collapsible-opt-groups=\"true\" data-enable-filtering=\"true\" data-include-select-all-option=\"true\" data-number-displayed=\"true\" class=\"btn-danger multi-select-field\" multiple=\"multiple\"><optgroup label=\"North America\"><option value=\"US\">United statuss</option>
|
18
|
+
expected = "<select name=\"example[]\" id=\"example\" data-enable-clickable-opt-groups=\"true\" data-enable-collapsible-opt-groups=\"true\" data-enable-filtering=\"true\" data-include-select-all-option=\"true\" data-number-displayed=\"true\" data-dropdown-classes=\"dropdown\" class=\"btn-danger multi-select-field\" multiple=\"multiple\"><optgroup label=\"North America\"><option value=\"US\">United statuss</option>
|
19
19
|
<option value=\"Canada\">Canada</option></optgroup><optgroup label=\"Europe\"><option value=\"Denmark\">Denmark</option>
|
20
20
|
<option value=\"Germany\">Germany</option>
|
21
21
|
<option value=\"France\">France</option></optgroup></select>"
|
@@ -25,7 +25,7 @@ class DropdownSelectFieldTest < ActionView::TestCase
|
|
25
25
|
|
26
26
|
test 'Multi select Field refresh option' do
|
27
27
|
actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { multiple: true, refresh: { target: { url: '/' } } }).render
|
28
|
-
expected =
|
28
|
+
expected = "<div class=\"field-refresh input-group ui_surround_field\"><select name=\"test[]\" id=\"test\" data-dropdown-classes=\"dropdown\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"></select><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#test","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i></span></div>"
|
29
29
|
|
30
30
|
assert_equal expected, actual
|
31
31
|
end
|
@@ -14,7 +14,7 @@ class SelectFieldTest < ActionView::TestCase
|
|
14
14
|
|
15
15
|
test 'Select Field refresh' do
|
16
16
|
actual = UiBibz::Ui::Core::Forms::Selects::SelectField.new('example', refresh: { target: { url: '/' } }).render
|
17
|
-
expected =
|
17
|
+
expected = "<div class=\"field-refresh input-group ui_surround_field\"><select name=\"example\" id=\"example\" class=\"select-field form-control form-select\"></select><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#example","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i></span></div>"
|
18
18
|
|
19
19
|
assert_equal expected, actual
|
20
20
|
end
|
@@ -31,7 +31,7 @@ class SurroundFieldTest < ActionView::TestCase
|
|
31
31
|
d.link 'Link3', url: '#link3'
|
32
32
|
end
|
33
33
|
end.render
|
34
|
-
expected =
|
34
|
+
expected = "<div class=\"input-group ui_surround_field\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"dropdown-test\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"dropdown-test\"><a class=\"dropdown-item\" href=\"#link1\"><i class=\"glyph fas fa-eye\"></i> Link 1</a><h6 class=\"dropdown-header\" role=\"presentation\">header</h6><a class=\"dropdown-item\" href=\"#link2\">Link 2</a><div class=\"dropdown-divider\"></div><a class=\"dropdown-item\" href=\"#link3\">Link3</a></div></div>"
|
35
35
|
|
36
36
|
assert_equal expected, actual
|
37
37
|
end
|
@@ -87,7 +87,7 @@ class SurroundFieldTest < ActionView::TestCase
|
|
87
87
|
sf.button_refresh
|
88
88
|
end.render
|
89
89
|
|
90
|
-
expected = "<div class=\"input-group ui_surround_field\"><span class=\"input-group-text\"><i class=\"glyph fas fa-gem\"></i></span><span class=\"input-group-text\">test</span><button class=\"btn-secondary btn\">button</button><div class=\"input-group-btn\" role=\"group\"><button class=\"btn-secondary btn\">test</button></div><a class=\"btn-secondary btn\" role=\"button\" href=\"#\">link</a><div class=\"input-group-text\" label=\"false\"><input type=\"checkbox\" name=\"check\" id=\"check\" value=\"1\" class=\"form-check-input\" /><label class=\"form-check-label\" for=\"check\">check</label></div><div class=\"input-group-text\" label=\"false\"><input type=\"radio\" name=\"radio\" id=\"radio_\" class=\"form-check-input\" /><label class=\"form-check-label\" for=\"radio_\">radio</label></div><input type=\"text\" name=\"text\" id=\"text\" class=\"form-control\" /><input type=\"text\" name=\"date\" id=\"date\" data-date-locale=\"en\" data-provide=\"datepicker\" data-date-format=\"yyyy-mm-dd\" data-date-today-btn=\"linked\" data-date-toggle-active=\"true\" class=\"date_picker form-control\" /><select name=\"dropdown_select\" id=\"dropdown_select\" data-wrapper-classes=\"input-group-btn\" class=\"btn-secondary multi-select-field\"></select><select name=\"select\" id=\"select\" class=\"select-field form-control form-select\"></select><input type=\"text\" name=\"auto\" id=\"auto\" class=\"form-control auto-complete-field\" autocomplete=\"true\" list=\"auto-datalist\" /><datalist id=\"auto-datalist\"></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"","url":"","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i
|
90
|
+
expected = "<div class=\"input-group ui_surround_field\"><span class=\"input-group-text\"><i class=\"glyph fas fa-gem\"></i></span><span class=\"input-group-text\">test</span><button class=\"btn-secondary btn\">button</button><div class=\"input-group-btn\" role=\"group\"><button class=\"btn-secondary btn\">test</button></div><a class=\"btn-secondary btn\" role=\"button\" href=\"#\">link</a><div class=\"input-group-text\" label=\"false\"><input type=\"checkbox\" name=\"check\" id=\"check\" value=\"1\" class=\"form-check-input\" /><label class=\"form-check-label\" for=\"check\">check</label></div><div class=\"input-group-text\" label=\"false\"><input type=\"radio\" name=\"radio\" id=\"radio_\" class=\"form-check-input\" /><label class=\"form-check-label\" for=\"radio_\">radio</label></div><input type=\"text\" name=\"text\" id=\"text\" class=\"form-control\" /><input type=\"text\" name=\"date\" id=\"date\" data-date-locale=\"en\" data-provide=\"datepicker\" data-date-format=\"yyyy-mm-dd\" data-date-today-btn=\"linked\" data-date-toggle-active=\"true\" class=\"date_picker form-control\" /><select name=\"dropdown_select\" id=\"dropdown_select\" data-wrapper-classes=\"input-group-btn\" data-dropdown-classes=\"dropdown\" class=\"btn-secondary multi-select-field\"></select><select name=\"select\" id=\"select\" class=\"select-field form-control form-select\"></select><input type=\"text\" name=\"auto\" id=\"auto\" class=\"form-control auto-complete-field\" autocomplete=\"true\" list=\"auto-datalist\" /><datalist id=\"auto-datalist\"></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"","url":"","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i></span></div>"
|
91
91
|
|
92
92
|
assert_equal expected, actual
|
93
93
|
end
|
@@ -16,7 +16,7 @@ class AutoCompleteFieldTest < ActionView::TestCase
|
|
16
16
|
options = options_for_select(Array.new(2) { |i| "option #{i}" })
|
17
17
|
actual = UiBibz::Ui::Core::Forms::Texts::AutoCompleteField.new('test', { option_tags: options, refresh: { target: { url: '/' } } }, { id: 'test' }).render
|
18
18
|
expected = "<div class=\"field-refresh input-group ui_surround_field\"><input type=\"text\" name=\"test\" id=\"test\" class=\"form-control auto-complete-field\" autocomplete=\"true\" list=\"test-datalist\" /><datalist id=\"test-datalist\"><option value=\"option 0\">option 0</option>
|
19
|
-
<option value=\"option 1\">option 1</option></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#test-datalist","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i
|
19
|
+
<option value=\"option 1\">option 1</option></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#test-datalist","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i></span></div>"
|
20
20
|
|
21
21
|
assert_equal expected, actual
|
22
22
|
end
|
@@ -25,7 +25,7 @@ class AutoCompleteFieldTest < ActionView::TestCase
|
|
25
25
|
options = options_for_select(Array.new(2) { |i| "option #{i}" })
|
26
26
|
actual = UiBibz::Ui::Core::Forms::Texts::AutoCompleteField.new('test', { option_tags: options, append: 'Append content', refresh: { target: { url: '/' } } }, { id: 'test' }).render
|
27
27
|
expected = "<div class=\"field-refresh input-group ui_surround_field\"><span class=\"input-group-text\">Append content</span><input type=\"text\" name=\"test\" id=\"test\" class=\"form-control auto-complete-field\" autocomplete=\"true\" list=\"test-datalist\" /><datalist id=\"test-datalist\"><option value=\"option 0\">option 0</option>
|
28
|
-
<option value=\"option 1\">option 1</option></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#test-datalist","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i
|
28
|
+
<option value=\"option 1\">option 1</option></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#test-datalist","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i></span></div>"
|
29
29
|
|
30
30
|
assert_equal expected, actual
|
31
31
|
end
|
@@ -13,7 +13,7 @@ class ListGroupTest < ActionView::TestCase
|
|
13
13
|
l.body 'My body'
|
14
14
|
end
|
15
15
|
end
|
16
|
-
expected =
|
16
|
+
expected = "<div class=\"list-group\"><a href=\"#momo\" class=\"list-group-item-success list-group-item list-group-item-action\">Momo</a><a href=\"#state\" class=\"list-group-item list-group-item-action\"><div class=\"d-flex w-100 justify-content-between\"><h5 class=\"mb-1\">My title</h5><small></small></div><p class=\"mb-1\">My body</p><small></small></a></div>"
|
17
17
|
|
18
18
|
assert_equal expected, actual
|
19
19
|
end
|
@@ -10,7 +10,7 @@ class BreadcrumbTest < ActionView::TestCase
|
|
10
10
|
b.link 'Home', url: '#home', glyph: 'home'
|
11
11
|
b.link 'state', { url: '#state', state: :active }
|
12
12
|
end
|
13
|
-
expected =
|
13
|
+
expected = "<nav arial-label=\"breadcrumb\"><ol class=\"breadcrumb\"><li class=\"breadcrumb-item\"><a href=\"#home\"><i class=\"glyph fas fa-home\"></i> Home</a></li><li class=\"active breadcrumb-item\"><a href=\"#state\">state</a></li></ol></nav>"
|
14
14
|
|
15
15
|
assert_equal expected, actual
|
16
16
|
end
|
@@ -13,14 +13,14 @@ class LinkTest < ActionView::TestCase
|
|
13
13
|
|
14
14
|
test 'Link without text' do
|
15
15
|
actual = ui_link 'My link', glyph: 'gem', text: false, url: '#link'
|
16
|
-
expected =
|
16
|
+
expected = "<a href=\"#link\"><i class=\"glyph fas fa-gem\"></i> <span class=\"visually-hidden\">My link</span></a>"
|
17
17
|
|
18
18
|
assert_equal expected, actual
|
19
19
|
end
|
20
20
|
|
21
21
|
test 'Link with collapse option' do
|
22
22
|
actual = ui_link 'My link', url: '#link', collapse: 'collapse-id'
|
23
|
-
expected = '<a role="button" data-toggle="collapse" aria-controls="collapse-id" aria-expanded="false" href="#link">My link</a>'
|
23
|
+
expected = '<a role="button" data-bs-toggle="collapse" aria-controls="collapse-id" aria-expanded="false" href="#link">My link</a>'
|
24
24
|
|
25
25
|
assert_equal expected, actual
|
26
26
|
end
|
@@ -10,7 +10,7 @@ class NavTest < ActionView::TestCase
|
|
10
10
|
n.link 'Profile', url: '#profile', selector: 'profile'
|
11
11
|
n.link 'Messages', url: '#messages', selector: 'messages'
|
12
12
|
end
|
13
|
-
expected = "<ul class=\"nav nav-tabs\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
13
|
+
expected = "<ul class=\"nav nav-tabs\" role=\"tablist\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
14
14
|
|
15
15
|
assert_equal expected, actual
|
16
16
|
end
|
@@ -65,7 +65,7 @@ class NavTest < ActionView::TestCase
|
|
65
65
|
n.link 'Profile', url: '#profile', selector: 'profile', label: 16
|
66
66
|
n.link 'Messages', url: '#messages', selector: 'messages', state: :disabled
|
67
67
|
end
|
68
|
-
expected = "<div class=\"list-group\" role=\"tablist\"><a href=\"#Home\" class=\"active list-group-item list-group-item-action\" data-toggle=\"tab\" role=\"tab\" aria-controls=\"
|
68
|
+
expected = "<div class=\"list-group\" role=\"tablist\"><a href=\"#Home\" class=\"active list-group-item list-group-item-action\" data-bs-toggle=\"tab\" role=\"tab\" aria-controls=\"home\">Home</a><a href=\"#profile\" class=\"list-group-item list-group-item-action\" data-bs-toggle=\"tab\" role=\"tab\" aria-controls=\"profile\">Profile</a><a href=\"#messages\" class=\"disabled list-group-item list-group-item-action\" data-bs-toggle=\"tab\" role=\"tab\" aria-controls=\"messages\">Messages</a></div>"
|
69
69
|
|
70
70
|
assert_equal expected, actual
|
71
71
|
end
|
@@ -4,14 +4,14 @@ require 'test_helper'
|
|
4
4
|
class NavbarTest < ActionView::TestCase
|
5
5
|
test 'Navbar' do
|
6
6
|
actual = UiBibz::Ui::Core::Navigations::Navbar.new
|
7
|
-
expected = "<nav class=\"navbar navbar-light navbar-expand-lg\"><div class=\"container\"><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-toggle=\"collapse\" data-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"></div></div></nav>"
|
7
|
+
expected = "<nav class=\"navbar navbar-light navbar-expand-lg\"><div class=\"container\"><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"></div></div></nav>"
|
8
8
|
|
9
9
|
assert_equal expected, actual.render
|
10
10
|
end
|
11
11
|
|
12
12
|
test 'Navbar with options' do
|
13
13
|
actual = UiBibz::Ui::Core::Navigations::Navbar.new(title: 'Brand', expand_size: :xs, status: :primary, position: :top, brand_position: :right)
|
14
|
-
expected = "<nav class=\"bg-primary navbar navbar-light fixed-top navbar-expand-xs\"><div class=\"container\"><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-toggle=\"collapse\" data-target=\"##{actual.id}\">☰</button><span class=\"navbar-brand\">Brand</span><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"></div></div></nav>"
|
14
|
+
expected = "<nav class=\"bg-primary navbar navbar-light fixed-top navbar-expand-xs\"><div class=\"container\"><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-target=\"##{actual.id}\">☰</button><span class=\"navbar-brand\">Brand</span><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"></div></div></nav>"
|
15
15
|
|
16
16
|
assert_equal expected, actual.render
|
17
17
|
end
|
@@ -30,7 +30,7 @@ class NavbarTest < ActionView::TestCase
|
|
30
30
|
end
|
31
31
|
nb.text 'test'
|
32
32
|
end
|
33
|
-
expected = "<nav class=\"navbar navbar-light navbar-expand-lg\"><div class=\"container\"><span class=\"navbar-brand\">Brand</span><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-toggle=\"collapse\" data-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"><ul class=\"navbar-nav\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\">Messages</a></li></ul><form type=\"form_tag\" position=\"right\" class=\"d-flex\" action=\"#\" accept-charset=\"UTF-8\" method=\"post\"><button class=\"btn-secondary btn\">Search</button></form><span class=\"navbar-text\">test</span></div></div></nav>"
|
33
|
+
expected = "<nav class=\"navbar navbar-light navbar-expand-lg\"><div class=\"container\"><span class=\"navbar-brand\">Brand</span><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"><ul class=\"navbar-nav\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\">Messages</a></li></ul><form type=\"form_tag\" position=\"right\" class=\"d-flex\" action=\"#\" accept-charset=\"UTF-8\" method=\"post\"><button class=\"btn-secondary btn\">Search</button></form><span class=\"navbar-text\">test</span></div></div></nav>"
|
34
34
|
|
35
35
|
assert_equal expected, actual.render
|
36
36
|
end
|
@@ -43,7 +43,7 @@ class NavbarTest < ActionView::TestCase
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
expected =
|
46
|
-
"<nav class=\"bg-dark navbar navbar-dark navbar-expand-lg\"><div class=\"container\"><span class=\"navbar-brand\"><img src=\"/images/ruby-white\" /></span><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-toggle=\"collapse\" data-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"><ul class=\"navbar-nav\"><li class=\"nav-item\"><a href=\"#link\" class=\"nav-link\">Link</a></li></ul></div></div></nav>"
|
46
|
+
"<nav class=\"bg-dark navbar navbar-dark navbar-expand-lg\"><div class=\"container\"><span class=\"navbar-brand\"><img src=\"/images/ruby-white\" /></span><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"><ul class=\"navbar-nav\"><li class=\"nav-item\"><a href=\"#link\" class=\"nav-link\">Link</a></li></ul></div></div></nav>"
|
47
47
|
|
48
48
|
assert_equal expected, actual.render
|
49
49
|
end
|
@@ -10,7 +10,7 @@ class TabGroupTest < ActionView::TestCase
|
|
10
10
|
n.tab 'Profile', url: '#profile', selector: 'profile'
|
11
11
|
n.tab 'Messages', url: '#messages', selector: 'messages'
|
12
12
|
end
|
13
|
-
expected = "<ul class=\"nav nav-tabs\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
13
|
+
expected = "<ul class=\"nav nav-tabs\" role=\"tablist\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
14
14
|
|
15
15
|
assert_equal expected, actual
|
16
16
|
end
|
@@ -21,7 +21,7 @@ class TabGroupTest < ActionView::TestCase
|
|
21
21
|
n.tab 'Profile', url: '#profile', selector: 'profile'
|
22
22
|
n.tab 'Messages', url: '#messages', selector: 'messages'
|
23
23
|
end
|
24
|
-
expected = "<ul class=\"nav nav-tabs\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
24
|
+
expected = "<ul class=\"nav nav-tabs\" role=\"tablist\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
25
25
|
|
26
26
|
assert_equal expected, actual
|
27
27
|
end
|
@@ -32,7 +32,7 @@ class TabGroupTest < ActionView::TestCase
|
|
32
32
|
n.tab 'Profile', url: '#profile', selector: 'profile'
|
33
33
|
n.tab 'Messages', url: '#messages', selector: 'messages'
|
34
34
|
end
|
35
|
-
expected =
|
35
|
+
expected = "<ul class=\"nav nav-tabs\" role=\"tablist\"><li class=\"nav-item\"><span class=\"active nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Home</span></li><li class=\"nav-item\"><span class=\"nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Profile</span></li><li class=\"nav-item\"><span class=\"nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Messages</span></li></ul>"
|
36
36
|
|
37
37
|
assert_equal expected, actual
|
38
38
|
end
|
@@ -43,7 +43,7 @@ class TabGroupTest < ActionView::TestCase
|
|
43
43
|
n.tab 'Profile', url: '#profile', selector: 'profile', label: 16
|
44
44
|
n.tab 'Messages', url: '#messages', selector: 'messages', state: :disabled
|
45
45
|
end
|
46
|
-
expected = "<ul class=\"nav nav-tabs justify-content-end\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"disabled nav-link\" data-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
46
|
+
expected = "<ul class=\"nav nav-tabs justify-content-end\" role=\"tablist\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"disabled nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
47
47
|
|
48
48
|
assert_equal expected, actual
|
49
49
|
end
|
@@ -54,7 +54,7 @@ class TabGroupTest < ActionView::TestCase
|
|
54
54
|
n.tab 'Profile', url: '#profile', selector: 'profile', label: 16
|
55
55
|
n.tab 'Messages', url: '#messages', selector: 'messages', state: :disabled
|
56
56
|
end
|
57
|
-
expected = "<ul class=\"nav nav-tabs\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"disabled nav-link\" data-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
57
|
+
expected = "<ul class=\"nav nav-tabs\" role=\"tablist\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"disabled nav-link\" data-bs-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
58
58
|
|
59
59
|
assert_equal expected, actual
|
60
60
|
end
|
@@ -16,7 +16,7 @@ class AlertTest < ActionView::TestCase
|
|
16
16
|
a.header 'Information'
|
17
17
|
a.body 'Body text'
|
18
18
|
end
|
19
|
-
expected = "<div class=\"alert-success alert alert-dismissible\" role=\"alert\"><h4 class=\"alert-header\"><i class=\"glyph fas fa-thumbs-o-up\"></i>
|
19
|
+
expected = "<div class=\"alert-success alert alert-dismissible\" role=\"alert\"><h4 class=\"alert-header\"><i class=\"glyph fas fa-thumbs-o-up\"></i> Information<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button></h4><hr /><p class=\"alert-body mb-0\">Body text</p></div>"
|
20
20
|
|
21
21
|
assert_equal expected, actual
|
22
22
|
end
|
@@ -6,7 +6,7 @@ class BadgeTest < ActionView::TestCase
|
|
6
6
|
|
7
7
|
test 'badge' do
|
8
8
|
actual = ui_badge 'state', status: :success, glyph: 'pencil'
|
9
|
-
expected =
|
9
|
+
expected = "<span class=\"bg-success badge\"><i class=\"glyph fas fa-pencil\"></i> state</span>"
|
10
10
|
|
11
11
|
assert_equal expected, actual
|
12
12
|
end
|
@@ -20,7 +20,7 @@ class BadgeTest < ActionView::TestCase
|
|
20
20
|
|
21
21
|
test 'badge pill' do
|
22
22
|
actual = ui_badge 'state', status: :success, type: :pill, glyph: 'pencil'
|
23
|
-
expected =
|
23
|
+
expected = "<span class=\"bg-success badge rounded-pill\"><i class=\"glyph fas fa-pencil\"></i> state</span>"
|
24
24
|
|
25
25
|
assert_equal expected, actual
|
26
26
|
end
|
@@ -9,7 +9,7 @@ class ToastTest < ActionView::TestCase
|
|
9
9
|
t.header 'My header toast', glyph: 'eye', time: 'Now', class: 'my-header-toast'
|
10
10
|
t.body 'My body toast', class: 'my-body-toast'
|
11
11
|
end
|
12
|
-
expected = "<div data-autohide=\"true\" class=\"my-toast toast\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\"><div class=\"my-header-toast toast-header\"><i class=\"mr-2 glyph fas fa-eye\"></i><strong class=\"mr-auto\">My header toast</strong><small class=\"text-muted\">Now</small><button class=\"ml-2 mb-1 btn-close\" data-dismiss=\"toast\" aria-label=\"Close\"></button></div><div class=\"my-body-toast toast-body\">My body toast</div></div>"
|
12
|
+
expected = "<div data-bs-autohide=\"true\" class=\"my-toast toast\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\"><div class=\"my-header-toast toast-header\"><i class=\"mr-2 glyph fas fa-eye\"></i><strong class=\"mr-auto\">My header toast</strong><small class=\"text-muted\">Now</small><button class=\"ml-2 mb-1 btn-close\" data-bs-dismiss=\"toast\" aria-label=\"Close\"></button></div><div class=\"my-body-toast toast-body\">My body toast</div></div>"
|
13
13
|
|
14
14
|
assert_equal expected, actual
|
15
15
|
end
|
@@ -14,7 +14,7 @@ class UiHelperTest < ActionView::TestCase
|
|
14
14
|
concat ui_button_link 'Save', url: '#', status: :primary
|
15
15
|
end
|
16
16
|
end
|
17
|
-
expected = "<div class=\"modal\" tabindex=\"-1\" aria-labelledby=\"My title\" aria-hidden=\"true\"><div class=\"modal-dialog\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\">My title</h5><button class=\"btn-close\" data-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\">My body</div><div class=\"modal-footer\"><a class=\"btn-link btn\" role=\"button\" href=\"#\">Close</a><a class=\"btn-primary btn\" role=\"button\" href=\"#\">Save</a></div></div></div></div>"
|
17
|
+
expected = "<div class=\"modal\" tabindex=\"-1\" aria-labelledby=\"My title\" aria-hidden=\"true\"><div class=\"modal-dialog\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\">My title</h5><button class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\">My body</div><div class=\"modal-footer\"><a class=\"btn-link btn\" role=\"button\" href=\"#\">Close</a><a class=\"btn-primary btn\" role=\"button\" href=\"#\">Save</a></div></div></div></div>"
|
18
18
|
|
19
19
|
assert_equal expected, actual
|
20
20
|
end
|
@@ -28,7 +28,7 @@ class UiHelperTest < ActionView::TestCase
|
|
28
28
|
concat ui_button_link 'Save', url: '#', status: :primary
|
29
29
|
end
|
30
30
|
end
|
31
|
-
expected = "<div data-backdrop=\"static\" data-keyboard=\"false\" class=\"modal\" tabindex=\"-1\" aria-labelledby=\"My title\" aria-hidden=\"true\"><div class=\"modal-dialog modal-fullscreen modal-dialog-scrollable\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\">My title</h5><button class=\"btn-close\" data-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\">My body</div><div class=\"modal-footer\"><a class=\"btn-link btn\" role=\"button\" href=\"#\">Close</a><a class=\"btn-primary btn\" role=\"button\" href=\"#\">Save</a></div></div></div></div>"
|
31
|
+
expected = "<div data-backdrop=\"static\" data-keyboard=\"false\" class=\"modal\" tabindex=\"-1\" aria-labelledby=\"My title\" aria-hidden=\"true\"><div class=\"modal-dialog modal-fullscreen modal-dialog-scrollable\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\">My title</h5><button class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\">My body</div><div class=\"modal-footer\"><a class=\"btn-link btn\" role=\"button\" href=\"#\">Close</a><a class=\"btn-primary btn\" role=\"button\" href=\"#\">Save</a></div></div></div></div>"
|
32
32
|
|
33
33
|
assert_equal expected, actual
|
34
34
|
end
|