Sha256: 5f7d48b74abab9bb180db0642ac4b5fca034f13dcd0dd15735f8eb32b8b669eb

Contents?: true

Size: 1.12 KB

Versions: 11

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="me-2 text-danger 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

11 entries across 11 versions & 1 rubygems

Version Path
ui_bibz-4.0.0.beta16 test/ui/core/notifications/spinner_test.rb
ui_bibz-4.0.0.beta15 test/ui/core/notifications/spinner_test.rb
ui_bibz-4.0.0.beta14 test/ui/core/notifications/spinner_test.rb
ui_bibz-4.0.0.beta13 test/ui/core/notifications/spinner_test.rb
ui_bibz-4.0.0.beta10 test/ui/core/notifications/spinner_test.rb
ui_bibz-4.0.0.beta9 test/ui/core/notifications/spinner_test.rb
ui_bibz-4.0.0.beta8 test/ui/core/notifications/spinner_test.rb
ui_bibz-4.0.0.beta7 test/ui/core/notifications/spinner_test.rb
ui_bibz-4.0.0.beta6 test/ui/core/notifications/spinner_test.rb
ui_bibz-4.0.0.beta4 test/ui/core/notifications/spinner_test.rb
ui_bibz-4.0.0.beta3 test/ui/core/notifications/spinner_test.rb