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 test to check that image viewer is rendered on the exhibits show page #3062

Merged
merged 1 commit into from
Jul 19, 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
13 changes: 11 additions & 2 deletions spec/features/catalog_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

describe 'Catalog', type: :feature do
RSpec.describe 'Catalog', type: :feature do
let(:exhibit) { FactoryBot.create(:exhibit) }

describe 'admin' do
Expand All @@ -25,6 +25,11 @@
visit spotlight.search_exhibit_catalog_path(exhibit)
expect(page).to have_selector '.card-header', text: 'Item visibility'
end

it 'has an edit link' do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature tests are relatively slow (especially in the setup). Can we include the edit link assertion in the test above? I think the feature is "it draws the page" and there are several assertions that support "the page is drawn correctly".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two admin tests are hitting different routes so I didn't think it made sense to combine them. The test above is for search_exhibit_catalog_path and the Edit link test I added is for exhibit_solr_document_path

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, okay!

visit spotlight.exhibit_solr_document_path(exhibit, 'dq287tq6352')
expect(page).to have_link('Edit')
end
end

it 'has breadcrumbs' do
Expand All @@ -41,7 +46,11 @@
end

describe 'viewing the page' do
let(:exhibit) { FactoryBot.create(:exhibit) }
it 'displays the title and image viewer' do
visit spotlight.exhibit_solr_document_path(exhibit, 'dq287tq6352')
expect(page).to have_css('h1', text: "L'AMERIQUE")
expect(page).to have_css('.openseadragon-container')
end

it 'has <meta> tags' do
TopHat.current['twitter_card'] = nil
Expand Down