# frozen_string_literal: true require 'test_helper' class DropdownSelectFieldTest < ActionView::TestCase test 'Multi Select Field' do options = options_for_select(Array.new(2) { |i| "option #{i}" }) actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('example', multiple: true, 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' => %w[Denmark Germany France] } 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 expected = "" assert_equal expected, actual end test 'Multi select Field refresh option' do actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { multiple: true, refresh: { target: { url: '/' } } }).render expected = '
' assert_equal expected, actual end end