-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an alert message when a non-iiif item is autocompleted for cropping.
- Loading branch information
Showing
5 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
describe 'Autocomplete typeahead', type: :feature, js: true do | ||
let(:exhibit) { FactoryGirl.create(:exhibit) } | ||
let(:admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } | ||
|
||
before { login_as admin } | ||
|
||
describe 'IIIF Integration' do | ||
context 'for items that include a IIIF manifest' do | ||
it 'instantiates a cropper' do | ||
visit spotlight.edit_exhibit_appearance_path(exhibit) | ||
|
||
expect(page).not_to have_css('.leaflet-container') | ||
|
||
fill_in_typeahead_field(with: 'gk446cj2442', type: 'masthead') | ||
|
||
expect(page).to have_css('.leaflet-container', visible: true) | ||
end | ||
end | ||
|
||
context 'for items that do not include a IIIF manifest' do | ||
before do | ||
Spotlight::Engine.config.iiif_manifest_field = 'not_a_real_field' | ||
end | ||
|
||
it 'provides an alert informing the user that they cannot crop from that item' do | ||
visit spotlight.edit_exhibit_appearance_path(exhibit) | ||
|
||
expect(page).not_to have_css('[data-behavior="non-iiif-alert"]', visible: true) | ||
|
||
fill_in_typeahead_field(with: 'gk446cj2442', type: 'masthead') | ||
|
||
expect(page).to have_css('[data-behavior="non-iiif-alert"]', visible: true) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters