# frozen_string_literal: true require 'test_helper' class DropdownSelectFieldTest < ActionView::TestCase test 'dropdown_select_field' do options = options_for_select(Array.new(2) { |i| "option #{i}" }) actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', options_tags: options).render expected = '' assert_equal expected, actual end test 'dropdown_select_field searchable' do options = options_for_select(Array.new(2) { |i| "option #{i}" }) actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { options_tags: options, searchable: true }).render expected = '' assert_equal expected, actual end test 'dropdown_select_field max_options' do options = options_for_select(Array.new(2) { |i| "option #{i}" }) actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { options_tags: options, max_options: 2 }).render expected = '' assert_equal expected, actual end test 'dropdown_select_field selected_text_format' do options = options_for_select(Array.new(2) { |i| "option #{i}" }) actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { options_tags: options, selected_text_format: 'count > x' }).render expected = '' assert_equal expected, actual end test 'dropdown_select_field menu_size' do options = options_for_select(Array.new(2) { |i| "option #{i}" }) actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { options_tags: options, menu_size: 2 }).render expected = '' assert_equal expected, actual end test 'dropdown_select_field actions_box' do options = options_for_select(Array.new(2) { |i| "option #{i}" }) actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { options_tags: options, actions_box: true }).render expected = '' assert_equal expected, actual end test 'dropdown_select_field show_tick' do options = options_for_select(Array.new(2) { |i| "option #{i}" }) actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { options_tags: options, show_tick: true }).render expected = '' assert_equal expected, actual end test 'dropdown_select_field show_menu_arrow' do options = options_for_select(Array.new(2) { |i| "option #{i}" }) actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { options_tags: options, show_menu_arrow: true }).render expected = '' assert_equal expected, actual end test 'dropdown_select_field dropup' do options = options_for_select(Array.new(2) { |i| "option #{i}" }) actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { options_tags: options, dropup: true }).render expected = '' assert_equal expected, actual end test 'dropdown_select_field refresh' do actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { refresh: { mode: 'local', target: { data: [] } } }).render expected = '