require 'test_helper' class MultiSelectFieldTest < ActionView::TestCase test "Multi Select Field" do options = options_for_select(2.times.map{ |i| "option #{i}" }) actual = UiBibz::Ui::Core::Forms::Selects::MultiSelectField.new('example', option_tags: options).render expected = "" assert_equal expected, actual end test "Multi Select Field data html options" do grouped_options = { 'North America' => [['United statuss','US'], 'Canada'], 'Europe' => ['Denmark','Germany','France'] } actual = UiBibz::Ui::Core::Forms::Selects::MultiSelectField.new('example', { 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 expected = "" assert_equal expected, actual end test 'Multi select Field refresh option' do actual = UiBibz::Ui::Core::Forms::Selects::MultiSelectField.new('test', { refresh: { target: { url: '/'}}}).render expected = "
" assert_equal expected, actual end end