Sha256: ddf68f1e3f9cb474a9e42df7d6faddb2978895aa740761570ca301f91ab18c76

Contents?: true

Size: 913 Bytes

Versions: 13

Compression:

Stored size: 913 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'

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

  test 'create glyph with a name' do
    actual   = ui_glyph('add')
    expected = '<i class="glyph fa-solid fa-add"></i>'

    assert_equal expected, actual
  end

  test 'create glyph with hash' do
    actual   = ui_glyph({ name: 'add', size: 3, type: 'li' })
    expected = '<i class="glyph fa-solid fa-add fa-3x fa-li"></i>'

    assert_equal expected, actual
  end

  test 'create glyph with name and hash' do
    actual   = ui_glyph('add', { size: 3, type: 'li' })
    expected = '<i class="glyph fa-solid fa-add fa-3x fa-li"></i>'

    assert_equal expected, actual
  end

  test 'create glyph with label' do
    actual   = ui_glyph('add', { label: 'Example' })
    expected = '<i class="glyph fa-solid fa-add"></i> Example'

    assert_equal expected, actual
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ui_bibz-4.0.0.beta18 test/ui/core/icons/glyph_test.rb
ui_bibz-4.0.0.beta17 test/ui/core/icons/glyph_test.rb
ui_bibz-4.0.0.beta16 test/ui/core/icons/glyph_test.rb
ui_bibz-4.0.0.beta15 test/ui/core/icons/glyph_test.rb
ui_bibz-4.0.0.beta14 test/ui/core/icons/glyph_test.rb
ui_bibz-4.0.0.beta13 test/ui/core/icons/glyph_test.rb
ui_bibz-4.0.0.beta10 test/ui/core/icons/glyph_test.rb
ui_bibz-4.0.0.beta9 test/ui/core/icons/glyph_test.rb
ui_bibz-4.0.0.beta8 test/ui/core/icons/glyph_test.rb
ui_bibz-4.0.0.beta7 test/ui/core/icons/glyph_test.rb
ui_bibz-4.0.0.beta6 test/ui/core/icons/glyph_test.rb
ui_bibz-4.0.0.beta4 test/ui/core/icons/glyph_test.rb
ui_bibz-4.0.0.beta3 test/ui/core/icons/glyph_test.rb