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

395 - Add wait selectors to other college manipulation spec #396

Merged
merged 1 commit into from
Mar 12, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
before do
create_submitter(submitter)
visit new_artwork_path
find('input[name="artwork[author_first_name][]"]') # Wait for the page to load
expect(page).to have_selector('input[name="artwork[author_first_name][]"]') # Wait for the page to load
fill_in('artwork[author_first_name][]', with: artwork.author_first_name[0])
fill_in('artwork[author_last_name][]', with: artwork.author_last_name[0])
fill_in('artwork[work_title]', with: artwork.work_title)
Expand Down Expand Up @@ -41,6 +41,8 @@
other_checkbox.set(true)

# Now, the Other College field should be visible
expect(page).to have_selector('input[type="checkbox"]:checked', count: 1)
expect(page).to have_text('Other College')
expect(other_college_field).to be_visible

# Unselect the Other checkbox
Expand Down Expand Up @@ -100,9 +102,10 @@
expect(page).to_not have_text('Other College')

click_on('Submit')

expect(page).to have_text('Instructions')
expect(page).to have_current_path(Rails.application.routes.url_helpers.publications_path)
click_on(artwork.work_title)
expect(page).to have_text 'Show Artwork'
expect(page).to_not have_text 'Other College Name'
end

Expand All @@ -115,8 +118,10 @@
fill_in('artwork[other_college]', with: 'Other College Name')
click_on('Submit')

expect(page).to have_text('Instructions')
expect(page).to have_current_path(Rails.application.routes.url_helpers.publications_path)
click_on(artwork.work_title)
expect(page).to have_text 'Show Artwork'
expect(page).to have_text 'Arts and Sciences'
expect(page).to have_text 'Other College Name'
end
Expand Down