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

WIP #3041

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

WIP #3041

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
31 changes: 17 additions & 14 deletions spec/features/javascript/blocks/solr_documents_block_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,26 @@
end

it 'allows you to toggle visibility of solr documents', js: true do
skip('Passes locally, but soooo flakey in CI.') if ENV['CI']
fill_in_solr_document_block_typeahead_field with: 'dq287tq6352'

# Flappy guard. Wait for the thumbnail src to be populated.
expect(page).to have_selector('li[data-resource-id="dq287tq6352"] .img-thumbnail[src^="http"]')

within(:css, '.card') do
uncheck 'Display?'
end

fill_in_solr_document_block_typeahead_field with: 'gk446cj2442'

# Flappy guard. Wait for the thumbnail src to be populated.
expect(page).to have_selector('li[data-resource-id="gk446cj2442"] .img-thumbnail[src^="http"]')

# display the title as the primary caption
within('.primary-caption') do
check('Primary caption')
select('Title', from: 'primary-caption-field')
end

# this seems silly, but also seems to help with the flappy-ness of this spec
expect(find_field('Primary caption', checked: true)).to be_checked

save_page

expect(page).to have_selector '.items-block .box', count: 1, visible: true
Expand All @@ -114,9 +116,6 @@
uncheck('Primary caption')
end

# this seems silly, but also seems to help with the flappy-ness of this spec
expect(find_field('Primary caption', checked: false)).not_to be_checked

save_page

expect(page).to have_selector '.items-block .box', count: 1, visible: true
Expand Down Expand Up @@ -148,13 +147,12 @@
end

it 'allows you to optionally display a ZPR link with the image', js: true do
skip('Passes locally, but soooo flakey on Travis.') if ENV['CI']

fill_in_solr_document_block_typeahead_field with: 'gk446cj2442'

# Flappy guard. Wait for the thumbnail src to be populated.
expect(page).to have_selector('li[data-resource-id="gk446cj2442"] .img-thumbnail[src^="http"]')

check 'Offer "View larger" option'
# this seems silly, but also seems to help with the flappy-ness of this spec
expect(find_field('Offer "View larger" option', checked: true)).to be_checked

save_page

Expand Down Expand Up @@ -182,13 +180,13 @@
end

it 'allows you to choose which side the text will be on', js: true do
skip('Passes locally, but soooo flakey on Travis.') if ENV['CI']
fill_in_solr_document_block_typeahead_field with: 'dq287tq6352'

# Flappy guard. Wait for the thumbnail src to be populated.
expect(page).to have_selector('li[data-resource-id="dq287tq6352"] .img-thumbnail[src^="http"]')

# Select to align the text right
choose 'Left'
# this seems silly, but also seems to help with the flappy-ness of this spec
expect(find_field('Left', checked: true)).to be_checked

# fill in the content editable div
content_editable = find('.st-text-block')
Expand All @@ -209,11 +207,16 @@
it 'round-trip data', js: true do
fill_in_solr_document_block_typeahead_field with: 'dq287tq6352'

# Flappy guard. Wait for the thumbnail src to be populated.
expect(page).to have_selector('li[data-resource-id="dq287tq6352"] .img-thumbnail[src^="http"]')

within(:css, '.card') do
uncheck 'Display?'
end

fill_in_solr_document_block_typeahead_field with: 'gk446cj2442'
# Flappy guard. Wait for the thumbnail src to be populated.
expect(page).to have_selector('li[data-resource-id="gk446cj2442"] .img-thumbnail[src^="http"]')

# display the title as the primary caption
within('.primary-caption') do
Expand Down
Loading