<commit_before>require 'test_helper'

class ButtonTest < ActionView::TestCase
  include UiBibz::Helpers::Ui::CoreHelper

  test "button" do
    actual   = ui_button('state')
    expected = "<button class=\"btn\">state</button>"

    assert_equal expected, actual
  end

  test "button with status" do
    actual   = ui_button('state', status: :success)
    expected = "<button class=\"btn-success btn\">state</button>"

    assert_equal expected, actual
  end

  test 'button outline' do
    actual   = ui_button('state', status: :success, outline: true)
    expected = "<button class=\"btn-outline-success btn\">state</button>"

    assert_equal expected, actual
  end

  test 'button disabled' do
    actual   = ui_button('state', state: :disabled)
    expected = "<button class=\"disabled btn\" disabled=\"disabled\">state</button>"

    assert_equal expected, actual
  end

  test 'button active' do
    actual   = ui_button('state', state: :active)
    expected = "<button class=\"active btn\" aria-pressed=\"true\">state</button>"

    assert_equal expected, actual
  end

  test 'button badge' do
    actual   = ui_button('state', badge: 2)
    expected = "<button class=\"btn\">state<span class=\"badge-secondary badge\">2</span></button>"

    assert_equal expected, actual
  end

  test 'button block' do
    actual   = ui_button('state', type: :block)
    expected = "<button class=\"btn btn-block\">state</button>"

    assert_equal expected, actual
  end

  test 'button size' do
    actual   = ui_button('state', size: :sm)
    expected = "<button class=\"btn btn-sm\">state</button>"

    assert_equal expected, actual
  end

  test 'button toggle' do
    actual   = ui_button('state', toggle: true)
    expected = "<button class=\"btn\" data-toggle=\"button\" aria-pressed=\"false\" autocomplete=\"off\">state</button>"

    assert_equal expected, actual
  end

  test 'button glyph' do
    actual   = ui_button('state', glyph: 'diamond')
    expected = "<button class=\"btn\"><i class=\"glyph fa fa-diamond\"></i> state</button>"

    assert_equal expected, actual
  end

  test 'button glyph without text' do
    actual   = ui_button('state', glyph: 'diamond', text: false)
    expected = "<button class=\"btn without-text\"><i class=\"glyph fa fa-diamond\"></i>  </button>"

    assert_equal expected, actual
  end
end<commit_msg>fix tests bug<commit_after>require 'test_helper'

class ButtonTest < ActionView::TestCase
  include UiBibz::Helpers::Ui::CoreHelper

  test "button" do
    actual   = ui_button('state')
    expected = "<button class=\"btn\">state</button>"

    assert_equal expected, actual
  end

  test "button with status" do
    actual   = ui_button('state', status: :success)
    expected = "<button class=\"btn-success btn\">state</button>"

    assert_equal expected, actual
  end

  test 'button outline' do
    actual   = ui_button('state', status: :success, outline: true)
    expected = "<button class=\"btn-outline-success btn\">state</button>"

    assert_equal expected, actual
  end

  test 'button disabled' do
    actual   = ui_button('state', state: :disabled)
    expected = "<button class=\"disabled btn\" disabled=\"disabled\">state</button>"

    assert_equal expected, actual
  end

  test 'button active' do
    actual   = ui_button('state', state: :active)
    expected = "<button class=\"active btn\" aria-pressed=\"true\">state</button>"

    assert_equal expected, actual
  end

  test 'button badge' do
    actual   = ui_button('state', badge: 2)
    expected = "<button class=\"btn\">state<span class=\"badge-secondary badge\">2</span></button>"

    assert_equal expected, actual
  end

  test 'button block' do
    actual   = ui_button('state', type: :block)
    expected = "<button class=\"btn btn-block\">state</button>"

    assert_equal expected, actual
  end

  test 'button size' do
    actual   = ui_button('state', size: :sm)
    expected = "<button class=\"btn btn-sm\">state</button>"

    assert_equal expected, actual
  end

  test 'button toggle' do
    actual   = ui_button('state', toggle: true)
    expected = "<button class=\"btn\" data-toggle=\"button\" aria-pressed=\"false\" autocomplete=\"off\">state</button>"

    assert_equal expected, actual
  end

  test 'button glyph' do
    actual   = ui_button('state', glyph: 'diamond')
    expected = "<button class=\"btn\"><i class=\"glyph fa fa-diamond\"></i> state</button>"

    assert_equal expected, actual
  end

  test 'button glyph without text' do
    actual   = ui_button('state', glyph: 'diamond', text: false)
    expected = "<button class=\"btn without-text\" title=\"state\"><i class=\"glyph fa fa-diamond\"></i>  </button>"

    assert_equal expected, actual
  end
end
{'fraction_non_alphanumeric': 0.14785744590581248, 'fraction_numerical': 0.0008485362749257531, 'mean_word_length': 3.6044921875, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6634673', 'n_tokens_mistral': 1429, 'n_tokens_neox': 1366, 'n_words': 400}