Sha256: ea164d686cd924cc28d9afb42ef3cda4bb7bfe9d609d0a0a23ea7644ed909da1
Contents?: true
Size: 1.93 KB
Versions: 57
Compression:
Stored size: 1.93 KB
Contents
# frozen_string_literal: true require 'test_helper' class PaginationTest < ActionView::TestCase include UiBibz::Helpers::Ui::CoreHelper test 'Pagination' do actual = ui_pagination do |p| p.link 'Home', state: :active, url: '#Home', selector: 'home' p.link 'Profile', url: '#profile', selector: 'profile' p.link 'Messages', url: '#messages', selector: 'messages' end expected = '<nav><ul class="pagination"><li class="active page-item"><a class="page-link" href="#Home">Home</a></li><li class="page-item"><a class="page-link" href="#profile">Profile</a></li><li class="page-item"><a class="page-link" href="#messages">Messages</a></li></ul></nav>' assert_equal expected, actual end test 'Pagination size' do actual = ui_pagination size: :lg do |p| p.link 'Home', state: :active, url: '#Home', selector: 'home' p.link 'Profile', url: '#profile', selector: 'profile' p.link 'Messages', url: '#messages', selector: 'messages' end expected = '<nav><ul class="pagination pagination-lg"><li class="active page-item"><a class="page-link" href="#Home">Home</a></li><li class="page-item"><a class="page-link" href="#profile">Profile</a></li><li class="page-item"><a class="page-link" href="#messages">Messages</a></li></ul></nav>' assert_equal expected, actual end test 'Pagination position' do actual = ui_pagination position: :right do |p| p.link 'Home', state: :active, url: '#Home', selector: 'home' p.link 'Profile', url: '#profile', selector: 'profile' p.link 'Messages', url: '#messages', selector: 'messages' end expected = '<nav><ul class="pagination justify-content-end"><li class="active page-item"><a class="page-link" href="#Home">Home</a></li><li class="page-item"><a class="page-link" href="#profile">Profile</a></li><li class="page-item"><a class="page-link" href="#messages">Messages</a></li></ul></nav>' assert_equal expected, actual end end
Version data entries
57 entries across 57 versions & 1 rubygems