require 'test_helper'
class SurroundFieldTest < ActionView::TestCase
test 'surround_field with glyph' do
actual = UiBibz::Ui::Core::Forms::Surrounds::SurroundField.new.tap do |sf|
sf.glyph 'pencil'
end.render
expected = "
"
assert_equal expected, actual
end
test 'surround_field with addon' do
actual = UiBibz::Ui::Core::Forms::Surrounds::SurroundField.new.tap do |sf|
sf.addon 'content addon'
end.render
expected = "content addon
"
assert_equal expected, actual
end
test 'surround_field with dropdown' do
actual = UiBibz::Ui::Core::Forms::Surrounds::SurroundField.new.tap do |sf|
sf.dropdown "Dropdown", {}, { id: 'dropdown-test'} do |d|
d.link 'Link 1', url: '#link1', glyph: 'eye'
d.header 'header'
d.link 'Link 2', url: '#link2'
d.divider
d.link 'Link3', url: '#link3'
end
end.render
expected = ""
assert_equal expected, actual
end
test 'surround_field with button' do
actual = UiBibz::Ui::Core::Forms::Surrounds::SurroundField.new.tap do |sf|
sf.button 'Submit'
end.render
expected = ""
assert_equal expected, actual
end
test 'surround_field with button, addon, glyph' do
actual = UiBibz::Ui::Core::Forms::Surrounds::SurroundField.new.tap do |sf|
sf.button 'Submit'
sf.addon '€'
sf.glyph 'pencil'
end.render
expected = ""
assert_equal expected, actual
end
end