Sha256: c3650685ad6391e2ec7d89cc86065caa5bb57e7141ebfbfa52c4fc8a28dacc73

Contents?: true

Size: 828 Bytes

Versions: 5

Compression:

Stored size: 828 Bytes

Contents

# frozen_string_literal: true

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

  test 'badge' do
    actual   = ui_badge 'state', status: :success, glyph: 'pencil'
    expected = '<span class="bg-success badge"><i class="glyph fas fa-pencil"></i>  state</span>'

    assert_equal expected, actual
  end

  test 'badge with url' do
    actual   = ui_badge 'state', url: 'http://example.com'
    expected = '<a class="bg-default badge" href="http://example.com">state</a>'

    assert_equal expected, actual
  end

  test 'badge pill' do
    actual   = ui_badge 'state', status: :success, type: :pill, glyph: 'pencil'
    expected = '<span class="bg-success badge rounded-pill"><i class="glyph fas fa-pencil"></i>  state</span>'

    assert_equal expected, actual
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ui_bibz-3.0.0.alpha8 test/ui/core/notifications/badge_test.rb
ui_bibz-3.0.0.alpha6 test/ui/core/notifications/badge_test.rb
ui_bibz-3.0.0.alpha5 test/ui/core/notifications/badge_test.rb
ui_bibz-3.0.0.alpha3 test/ui/core/notifications/badge_test.rb
ui_bibz-3.0.0.alpha2 test/ui/core/notifications/badge_test.rb