Sha256: db8717837cfc00e9075d65d0f7e348ae29802f569fc75f22481348d8b16a5fb1
Contents?: true
Size: 885 Bytes
Versions: 37
Compression:
Stored size: 885 Bytes
Contents
# frozen_string_literal: true require 'test_helper' class ComponentTest < ActionView::TestCase test 'create complex component' do actual = UiBibz::Ui::Core::Component.new('New component', { state: :active, glyph: 'add' }, { class: 'new-class' }).render expected = "<i class=\"glyph fas fa-add\"></i> New component" assert_equal expected, actual end test 'create complex component with block' do actual = UiBibz::Ui::Core::Component.new(state: :active) do 'New content' end.render expected = 'New content' assert_equal expected, actual end test 'create component without text and glyph' do actual = UiBibz::Ui::Core::Component.new('My text', { glyph: 'diamond', text: false }).render expected = "<i class=\"glyph fas fa-diamond\"></i> <span class=\"visually-hidden\">My text</span>" assert_equal expected, actual end end
Version data entries
37 entries across 37 versions & 1 rubygems