Sha256: 6981fe02fa1ffa2a1106c6c8c08a08b2ce1973c8496c602bf0328e46e14581ac
Contents?: true
Size: 1.9 KB
Versions: 13
Compression:
Stored size: 1.9 KB
Contents
# frozen_string_literal: true require 'test_helper' class ButtonGroupTest < ActionView::TestCase include UiBibz::Helpers::Ui::CoreHelper test 'button group' do actual = ui_button_group do |bg| bg.button 'state' end expected = '<div class="btn-group" role="group"><button class="btn-secondary btn">state</button></div>' assert_equal expected, actual end test 'button group vertical' do actual = ui_button_group(position: :vertical) do |bg| bg.button 'state' end expected = '<div class="btn-group-vertical" role="group"><button class="btn-secondary btn">state</button></div>' assert_equal expected, actual end test 'button group status' do actual = ui_button_group(status: :primary) do |bg| bg.button 'state' end expected = '<div class="btn-group" role="group"><button class="btn-primary btn">state</button></div>' assert_equal expected, actual end test 'button group size' do actual = ui_button_group(size: :sm) do |bg| bg.button 'state' end expected = '<div class="btn-group btn-group-sm" role="group"><button class="btn-secondary btn btn-sm">state</button></div>' assert_equal expected, actual end test 'button group with dropdown' do actual = ui_button_group do |bg| bg.dropdown('Dropdown', { position: :up, status: :success }, { id: 'dropdown-test' }) do |d| d.link 'Link 1', url: '#link1', glyph: 'eye' end end expected = "<div class=\"btn-group\" role=\"group\"><div id=\"dropdown-test\" class=\"dropup btn-group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" 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 fa-solid fa-eye\"></i> Link 1</a></div></div></div>" assert_equal expected, actual end end
Version data entries
13 entries across 13 versions & 1 rubygems