Sha256: d2ad1a441c1f9608b5a20b7efadd228013b00b71ea234d7c0d7a64b5923ffb5b

Contents?: true

Size: 695 Bytes

Versions: 2

Compression:

Stored size: 695 Bytes

Contents

# frozen_string_literal: true

shared_examples "a paginated resource" do
  let(:collection_size) { 50 }

  before do
    visit_component
  end

  it "lists 25 resources per page by default" do
    expect(page).to have_css(resource_selector, count: 25)
    expect(page).to have_css("[data-pages] [data-page]", count: 2)
  end

  it "results per page can be changed from the selector" do
    expect(page).to have_css("[data-pagination]")

    within "[data-pagination]" do
      page.find("summary", text: "25").click
      click_link "50"
    end

    sleep 2
    expect(page).to have_css(resource_selector, count: collection_size)
    expect(page).not_to have_css("[data-pagination]")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
decidim-core-0.28.4 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.28.3 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb