Sha256: 0681f2004607d2c2206cfa7f76962b7323cf769c193a2d5d60aa746f7fbc17cb

Contents?: true

Size: 1.12 KB

Versions: 16

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

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

  test 'spinner' do
    actual   = ui_spinner
    expected = '<div class="spinner-border" role="status"><span class="sr-only">Loading...</span></div>'

    assert_equal expected, actual
  end

  test 'spinner with status and content' do
    actual   = ui_spinner 'My spinner', status: :secondary
    expected = '<div class="text-secondary spinner-border" role="status"><span class="sr-only">My spinner</span></div>'

    assert_equal expected, actual
  end

  test 'spinner type' do
    actual   = ui_spinner nil, type: :grow
    expected = '<div class="spinner-grow" role="status"><span class="sr-only">Loading...</span></div>'

    assert_equal expected, actual
  end

  test 'spinner in button' do
    actual   = ui_button 'Load', spinner: { status: :danger, type: :grow }
    expected = '<button class="btn-secondary btn"><span class="text-danger mr-2 spinner-grow spinner-grow-sm" role="status"><span class="sr-only">Loading...</span></span>Load</button>'

    assert_equal expected, actual
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ui_bibz-3.0.0.beta1 test/ui/core/notifications/spinner_test.rb
ui_bibz-3.0.0.alpha12 test/ui/core/notifications/spinner_test.rb
ui_bibz-3.0.0.alpha11 test/ui/core/notifications/spinner_test.rb
ui_bibz-3.0.0.alpha10 test/ui/core/notifications/spinner_test.rb
ui_bibz-3.0.0.alpha9 test/ui/core/notifications/spinner_test.rb
ui_bibz-3.0.0.alpha8 test/ui/core/notifications/spinner_test.rb
ui_bibz-3.0.0.alpha6 test/ui/core/notifications/spinner_test.rb
ui_bibz-3.0.0.alpha5 test/ui/core/notifications/spinner_test.rb
ui_bibz-3.0.0.alpha3 test/ui/core/notifications/spinner_test.rb
ui_bibz-3.0.0.alpha2 test/ui/core/notifications/spinner_test.rb
ui_bibz-2.5.6 test/ui/core/notifications/spinner_test.rb
ui_bibz-2.5.5 test/ui/core/notifications/spinner_test.rb
ui_bibz-2.5.3 test/ui/core/notifications/spinner_test.rb
ui_bibz-2.5.2 test/ui/core/notifications/spinner_test.rb
ui_bibz-2.5.1 test/ui/core/notifications/spinner_test.rb
ui_bibz-2.5.0 test/ui/core/notifications/spinner_test.rb