Sha256: dd2b275e7aa21bb2566de68e5816387acef00ce1739854db54cfa9fc0540ccf7

Contents?: true

Size: 1001 Bytes

Versions: 16

Compression:

Stored size: 1001 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'
class ToolbarTest < ActionView::TestCase
  include UiBibz::Helpers::Ui::CoreHelper

  test 'Toolbar' do
    actual = ui_toolbar do |t|
      t.button_group do |bg|
        bg.button 'Home'
      end
    end
    expected = '<div class="btn-toolbar" role="toolbar"><div class="btn-group" role="group"><button class="btn-secondary btn">Home</button></div></div>'

    assert_equal expected, actual
  end

  test 'Toolbar justify' do
    actual = ui_toolbar justify: true do |t|
      t.button_group do |bg|
        bg.button 'Home'
      end
      t.spacer 2
      t.button_group do |bg|
        bg.button 'Home 2'
      end
    end
    expected = '<div class="btn-toolbar justify-content-between" role="toolbar"><div role="group" class="btn-group mr-2"><button class="btn-secondary btn">Home</button></div><div class="btn-group" role="group"><button class="btn-secondary btn">Home 2</button></div></div>'

    assert_equal expected, actual
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ui_bibz-3.0.0.beta1 test/ui/core/navigations/toolbar_test.rb
ui_bibz-3.0.0.alpha12 test/ui/core/navigations/toolbar_test.rb
ui_bibz-3.0.0.alpha11 test/ui/core/navigations/toolbar_test.rb
ui_bibz-3.0.0.alpha10 test/ui/core/navigations/toolbar_test.rb
ui_bibz-3.0.0.alpha9 test/ui/core/navigations/toolbar_test.rb
ui_bibz-3.0.0.alpha8 test/ui/core/navigations/toolbar_test.rb
ui_bibz-3.0.0.alpha6 test/ui/core/navigations/toolbar_test.rb
ui_bibz-3.0.0.alpha5 test/ui/core/navigations/toolbar_test.rb
ui_bibz-3.0.0.alpha3 test/ui/core/navigations/toolbar_test.rb
ui_bibz-3.0.0.alpha2 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.5.6 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.5.5 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.5.3 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.5.2 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.5.1 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.5.0 test/ui/core/navigations/toolbar_test.rb