Sha256: eb698fefa4fd6f81cd965c1f243f7472faa28431c380e2d6c541412a2f6b5cff

Contents?: true

Size: 833 Bytes

Versions: 4

Compression:

Stored size: 833 Bytes

Contents

# frozen_string_literal: true

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

  test 'Link' do
    actual = ui_link 'My link', url: '#link'
    expected = '<a href="#link">My link</a>'

    assert_equal expected, actual
  end

  test 'Link without text' do
    actual = ui_link 'My link', glyph: 'gem', text: false, url: '#link'
    expected = "<a href=\"#link\"><i class=\"glyph fas fa-gem\"></i> <span class=\"visually-hidden\">My link</span></a>"

    assert_equal expected, actual
  end

  test 'Link with collapse option' do
    actual = ui_link 'My link', url: '#link', collapse: 'collapse-id'
    expected = '<a role="button" data-toggle="collapse" aria-controls="collapse-id" aria-expanded="false" href="#link">My link</a>'

    assert_equal expected, actual
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ui_bibz-3.0.0.alpha12 test/ui/core/navigations/link_test.rb
ui_bibz-3.0.0.alpha11 test/ui/core/navigations/link_test.rb
ui_bibz-3.0.0.alpha10 test/ui/core/navigations/link_test.rb
ui_bibz-3.0.0.alpha9 test/ui/core/navigations/link_test.rb