Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add expectations, so that we're on the right page before clicking buttons #2613

Merged
merged 1 commit into from
Jan 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion spec/features/search_context_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
RSpec.describe "Search Results context" do
it "passes the current search id through", js: true do
search_for ''
search_id = Search.last.id.to_s
click_on 'Pluvial nectar of blessings'
search_id = Search.last.id.to_s
expect(page).to have_content "« Previous | 10 of 30 | Next »"
prev = page.find(".pagination-search-widgets .previous")
expect(prev['data-context-href']).to eq "/catalog/2003546302/track?counter=9&document_id=2003546302&search_id=#{search_id}"

click_on "« Previous"
expect(page).to have_content "U21.2 .W85 2003"

prev = page.find(".pagination-search-widgets .previous")
expect(prev['data-context-href']).to eq "/catalog/2004310986/track?counter=8&document_id=2004310986&search_id=#{search_id}"
Expand Down Expand Up @@ -48,6 +49,7 @@
find_all('.index_title a').last.click
click_on "Next »"

expect(page).to have_content "Naqdī barā-yi tamām-i"
click_on "Back to Search"
expect(page).to have_content "11 - 20"
end
Expand Down