blacklight 8.2.2 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.env +1 -1
- data/.github/workflows/ruby.yml +60 -62
- data/.rubocop.yml +229 -21
- data/.rubocop_todo.yml +22 -55
- data/Gemfile +2 -10
- data/README.md +2 -2
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight/blacklight.esm.js +5 -1
- data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +5 -1
- data/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
- data/app/assets/stylesheets/blacklight/_balanced_list.scss +1 -1
- data/app/assets/stylesheets/blacklight/_bookmark.scss +30 -0
- data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +0 -4
- data/app/assets/stylesheets/blacklight/_constraints.scss +15 -9
- data/app/assets/stylesheets/blacklight/_controls.scss +0 -1
- data/app/assets/stylesheets/blacklight/_facets.scss +33 -37
- data/app/assets/stylesheets/blacklight/_header.scss +2 -35
- data/app/assets/stylesheets/blacklight/_icons.scss +3 -2
- data/app/assets/stylesheets/blacklight/_layout.scss +3 -0
- data/app/assets/stylesheets/blacklight/_mixins.scss +6 -21
- data/app/assets/stylesheets/blacklight/_search_form.scss +3 -8
- data/app/assets/stylesheets/blacklight/_search_history.scss +5 -5
- data/app/assets/stylesheets/blacklight/_search_results.scss +5 -2
- data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +16 -10
- data/app/components/blacklight/advanced_search_form_component.html.erb +1 -1
- data/app/components/blacklight/advanced_search_form_component.rb +6 -0
- data/app/components/blacklight/constraint_layout_component.html.erb +2 -9
- data/app/components/blacklight/constraint_layout_component.rb +8 -0
- data/app/components/blacklight/constraints_component.rb +3 -3
- data/app/components/blacklight/document/action_component.rb +2 -1
- data/app/components/blacklight/document/bookmark_component.html.erb +2 -1
- data/app/components/blacklight/document/bookmark_component.rb +6 -0
- data/app/components/blacklight/document/page_header_component.html.erb +7 -0
- data/app/components/blacklight/document/page_header_component.rb +85 -0
- data/app/components/blacklight/document_component.rb +1 -1
- data/app/components/blacklight/facet_component.rb +1 -1
- data/app/components/blacklight/facet_field_checkboxes_component.html.erb +1 -1
- data/app/components/blacklight/facet_field_checkboxes_component.rb +1 -1
- data/app/components/blacklight/facet_field_inclusive_constraint_component.html.erb +1 -1
- data/app/components/blacklight/facet_field_list_component.html.erb +1 -1
- data/app/components/blacklight/facet_item_component.rb +1 -1
- data/app/components/blacklight/facet_item_pivot_component.rb +2 -2
- data/app/components/blacklight/icons/bookmark_icon_component.rb +17 -0
- data/app/components/blacklight/icons/icon_component.rb +9 -4
- data/app/components/blacklight/icons/remove_component.rb +16 -0
- data/app/components/blacklight/metadata_field_component.html.erb +1 -1
- data/app/components/blacklight/metadata_field_component.rb +5 -0
- data/app/components/blacklight/response/facet_group_component.rb +1 -1
- data/app/components/blacklight/response/pagination_component.html.erb +1 -1
- data/app/components/blacklight/response/sort_component.html.erb +1 -6
- data/app/components/blacklight/response/sort_component.rb +15 -0
- data/app/components/blacklight/search/per_page_component.html.erb +2 -0
- data/app/components/blacklight/search/per_page_component.rb +50 -0
- data/app/components/blacklight/search_bar_component.html.erb +1 -1
- data/app/components/blacklight/search_context/server_item_pagination_component.html.erb +4 -7
- data/app/components/blacklight/skip_link_component.html.erb +7 -0
- data/app/components/blacklight/skip_link_component.rb +17 -0
- data/app/components/blacklight/system/dropdown_button_component.rb +18 -0
- data/app/components/blacklight/system/dropdown_component.rb +4 -7
- data/app/components/blacklight/system/flash_message_component.html.erb +1 -1
- data/app/components/blacklight/top_navbar_component.html.erb +2 -2
- data/app/components/blacklight/top_navbar_component.rb +4 -0
- data/app/helpers/blacklight/catalog_helper_behavior.rb +3 -5
- data/app/helpers/blacklight/component_helper_behavior.rb +4 -4
- data/app/helpers/blacklight/configuration_helper_behavior.rb +2 -0
- data/app/helpers/blacklight/layout_helper_behavior.rb +3 -3
- data/app/javascript/blacklight/checkbox_submit.js +5 -1
- data/app/models/concerns/blacklight/document/semantic_fields.rb +1 -1
- data/app/presenters/blacklight/facet_checkbox_item_presenter.rb +11 -0
- data/app/presenters/blacklight/facet_field_presenter.rb +9 -1
- data/app/services/blacklight/search_service.rb +9 -1
- data/app/views/catalog/_per_page_widget.html.erb +1 -10
- data/app/views/catalog/_search_results.html.erb +1 -1
- data/app/views/catalog/_show_main_content.html.erb +1 -1
- data/app/views/catalog/show.html.erb +0 -2
- data/app/views/catalog/suggest.html.erb +1 -1
- data/app/views/kaminari/blacklight/_page.html.erb +14 -8
- data/app/views/layouts/blacklight/base.html.erb +3 -4
- data/app/views/shared/_flash_messages.html.erb +1 -1
- data/blacklight.gemspec +4 -0
- data/{docker-compose.yml → compose.yaml} +1 -1
- data/config/locales/blacklight.ar.yml +3 -0
- data/config/locales/blacklight.de.yml +3 -0
- data/config/locales/blacklight.en.yml +216 -229
- data/config/locales/blacklight.es.yml +3 -0
- data/config/locales/blacklight.fr.yml +3 -0
- data/config/locales/blacklight.hu.yml +3 -0
- data/config/locales/blacklight.it.yml +3 -0
- data/config/locales/blacklight.nl.yml +3 -0
- data/config/locales/blacklight.pt-BR.yml +3 -0
- data/config/locales/blacklight.sq.yml +3 -0
- data/config/locales/blacklight.zh.yml +3 -0
- data/lib/blacklight/abstract_repository.rb +6 -0
- data/lib/blacklight/configuration.rb +33 -19
- data/lib/blacklight/nested_open_struct_with_hash_access.rb +2 -2
- data/lib/blacklight/parameters.rb +1 -1
- data/lib/blacklight/solr/repository.rb +11 -4
- data/lib/blacklight/solr/request.rb +1 -1
- data/lib/blacklight/solr/response/facets.rb +1 -1
- data/lib/blacklight/solr/response/params.rb +1 -1
- data/lib/blacklight/solr/response.rb +0 -12
- data/lib/blacklight/solr/search_builder_behavior.rb +2 -2
- data/lib/blacklight/solr.rb +0 -6
- data/lib/blacklight.rb +4 -14
- data/lib/generators/blacklight/assets/propshaft_generator.rb +2 -2
- data/lib/generators/blacklight/models_generator.rb +1 -1
- data/package.json +1 -1
- data/spec/components/blacklight/advanced_search_form_component_spec.rb +2 -2
- data/spec/components/blacklight/constraint_layout_component_spec.rb +11 -11
- data/spec/components/blacklight/constraints_component_spec.rb +9 -9
- data/spec/components/blacklight/document/action_component_spec.rb +1 -1
- data/spec/components/blacklight/document/group_component_spec.rb +3 -3
- data/spec/components/blacklight/document/page_header_component_spec.rb +92 -0
- data/spec/components/blacklight/document/sidebar_component_spec.rb +3 -4
- data/spec/components/blacklight/document_component_spec.rb +41 -25
- data/spec/components/blacklight/facet_component_spec.rb +2 -2
- data/spec/components/blacklight/facet_field_checkboxes_component_spec.rb +5 -5
- data/spec/components/blacklight/facet_field_list_component_spec.rb +13 -13
- data/spec/components/blacklight/facet_item_component_spec.rb +5 -5
- data/spec/components/blacklight/facet_item_pivot_component_spec.rb +6 -6
- data/spec/components/blacklight/header_component_spec.rb +1 -2
- data/spec/components/blacklight/hidden_search_state_component_spec.rb +6 -6
- data/spec/components/blacklight/icons/icon_component_spec.rb +42 -0
- data/spec/components/blacklight/metadata_field_component_spec.rb +3 -3
- data/spec/components/blacklight/response/pagination_component_spec.rb +4 -4
- data/spec/components/blacklight/search_context/server_applied_params_component_spec.rb +1 -1
- data/spec/components/blacklight/search_context/server_item_pagination_component_spec.rb +2 -4
- data/spec/components/blacklight/system/flash_message_component_spec.rb +5 -5
- data/spec/controllers/blacklight/catalog_spec.rb +2 -2
- data/spec/controllers/blacklight/{catalog/component_configuration_spec.rb → configurable_spec.rb} +1 -1
- data/spec/controllers/bookmarks_controller_spec.rb +10 -10
- data/spec/controllers/catalog_controller_spec.rb +29 -31
- data/spec/features/advanced_search_spec.rb +30 -16
- data/spec/features/alternate_controller_spec.rb +9 -9
- data/spec/features/axe_spec.rb +4 -4
- data/spec/features/bookmarks_spec.rb +34 -19
- data/spec/features/citation_spec.rb +1 -1
- data/spec/features/did_you_mean_spec.rb +23 -23
- data/spec/features/facet_missing_spec.rb +9 -9
- data/spec/features/facets_spec.rb +21 -20
- data/spec/features/modal_spec.rb +4 -4
- data/spec/features/record_view_spec.rb +2 -2
- data/spec/features/search_context_spec.rb +6 -6
- data/spec/features/search_crawler_spec.rb +5 -5
- data/spec/features/search_filters_spec.rb +65 -65
- data/spec/features/search_history_spec.rb +12 -12
- data/spec/features/search_pagination_spec.rb +10 -10
- data/spec/features/search_results_spec.rb +1 -1
- data/spec/features/search_sort_spec.rb +4 -4
- data/spec/features/search_spec.rb +25 -25
- data/spec/features/sitelinks_search_box_spec.rb +2 -2
- data/spec/features/sms_spec.rb +1 -1
- data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +2 -2
- data/spec/helpers/blacklight/layout_helper_behavior_spec.rb +20 -3
- data/spec/helpers/blacklight/render_partials_helper_behavior_spec.rb +2 -1
- data/spec/helpers/blacklight/url_helper_behavior_spec.rb +7 -8
- data/spec/helpers/blacklight_helper_spec.rb +13 -15
- data/spec/helpers/catalog_helper_spec.rb +3 -6
- data/spec/i18n_spec.rb +2 -1
- data/spec/lib/blacklight/nested_open_struct_with_hash_access_spec.rb +1 -1
- data/spec/lib/blacklight/open_struct_with_hash_access_spec.rb +1 -1
- data/spec/lib/blacklight/search_state_spec.rb +4 -4
- data/spec/lib/tasks/blacklight_task_spec.rb +2 -1
- data/spec/models/blacklight/configurable_spec.rb +1 -1
- data/spec/models/blacklight/configuration/context_spec.rb +1 -1
- data/spec/models/blacklight/configuration_spec.rb +14 -14
- data/spec/models/blacklight/document/active_model_shim_spec.rb +1 -1
- data/spec/models/blacklight/document/cache_key_spec.rb +1 -1
- data/spec/models/blacklight/document_spec.rb +1 -1
- data/spec/models/blacklight/facet_paginator_spec.rb +14 -14
- data/spec/models/blacklight/icon_spec.rb +1 -1
- data/spec/models/blacklight/search_builder_spec.rb +1 -1
- data/spec/models/blacklight/solr/document_spec.rb +3 -3
- data/spec/models/blacklight/solr/facet_paginator_spec.rb +1 -1
- data/spec/models/blacklight/solr/repository_spec.rb +33 -15
- data/spec/models/blacklight/solr/request_spec.rb +1 -1
- data/spec/models/blacklight/solr/response/facets_spec.rb +3 -3
- data/spec/models/blacklight/solr/response/group_response_spec.rb +1 -1
- data/spec/models/blacklight/solr/response/group_spec.rb +2 -2
- data/spec/models/blacklight/solr/response_spec.rb +3 -3
- data/spec/models/blacklight/solr/{search_builder_spec.rb → search_builder_behavior_spec.rb} +10 -20
- data/spec/models/blacklight/suggest/response_spec.rb +1 -1
- data/spec/models/blacklight/suggest_search_spec.rb +1 -1
- data/spec/models/blacklight/user_spec.rb +1 -1
- data/spec/models/bookmark_spec.rb +1 -1
- data/spec/models/solr_document_spec.rb +1 -1
- data/spec/presenters/blacklight/document_presenter_spec.rb +3 -4
- data/spec/presenters/blacklight/facet_checkbox_item_presenter_spec.rb +42 -0
- data/spec/presenters/blacklight/facet_field_presenter_spec.rb +14 -0
- data/spec/presenters/blacklight/field_presenter_spec.rb +1 -1
- data/spec/presenters/blacklight/index_presenter_spec.rb +2 -3
- data/spec/presenters/blacklight/json_presenter_spec.rb +1 -1
- data/spec/presenters/{pipeline_spec.rb → blacklight/rendering/pipeline_spec.rb} +1 -1
- data/spec/presenters/blacklight/show_presenter_spec.rb +5 -6
- data/spec/presenters/{thumbnail_presenter_spec.rb → blacklight/thumbnail_presenter_spec.rb} +5 -3
- data/spec/requests/load_suggestions_spec.rb +5 -5
- data/spec/routing/catalog_routing_spec.rb +1 -1
- data/spec/services/blacklight/field_retriever_spec.rb +1 -1
- data/spec/services/blacklight/search_service_spec.rb +11 -11
- data/spec/spec_helper.rb +2 -2
- data/spec/support/features/search_helpers.rb +2 -2
- data/spec/support/features/session_helpers.rb +3 -3
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +3 -3
- data/spec/views/catalog/_document.html.erb_spec.rb +1 -4
- data/spec/views/catalog/_document_list.html.erb_spec.rb +2 -2
- data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +5 -6
- data/spec/views/catalog/_facet_layout.html.erb_spec.rb +7 -7
- data/spec/views/catalog/_paginate_compact.html.erb_spec.rb +4 -4
- data/spec/views/catalog/_show_sidebar.erb_spec.rb +1 -4
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +1 -2
- data/spec/views/catalog/_view_type_group.html.erb_spec.rb +7 -7
- data/spec/views/catalog/email_success.html.erb_spec.rb +1 -1
- data/spec/views/catalog/facet.html.erb_spec.rb +1 -1
- data/spec/views/catalog/facet.json.jbuilder_spec.rb +1 -1
- data/spec/views/catalog/index.atom.builder_spec.rb +18 -19
- data/spec/views/catalog/index.html.erb_spec.rb +2 -4
- data/spec/views/catalog/index.json.jbuilder_spec.rb +5 -8
- data/spec/views/catalog/show.html.erb_spec.rb +3 -5
- data/spec/views/catalog/show.json.jbuilder_spec.rb +1 -2
- data/spec/views/catalog/sms_success.html.erb_spec.rb +1 -1
- data/spec/views/shared/_user_util_links.html.erb_spec.rb +2 -3
- data/tasks/blacklight.rake +5 -5
- metadata +84 -12
@@ -6,10 +6,10 @@ RSpec.describe "Did You Mean" do
|
|
6
6
|
describe "searching all fields" do
|
7
7
|
it "has suggestions" do
|
8
8
|
fill_in "q", with: 'politica'
|
9
|
-
|
9
|
+
click_on 'search'
|
10
10
|
|
11
11
|
expect(page).to have_content("Did you mean")
|
12
|
-
|
12
|
+
click_on 'policy'
|
13
13
|
within ("#sortAndPerPage") do
|
14
14
|
expect(page).to have_content "1 - 2 of 2"
|
15
15
|
end
|
@@ -22,15 +22,15 @@ RSpec.describe "Did You Mean" do
|
|
22
22
|
it "has suggestions" do
|
23
23
|
# yehudiyam is one letter away from a title word
|
24
24
|
fill_in "q", with: 'yehudiyam'
|
25
|
-
|
25
|
+
click_on 'search'
|
26
26
|
|
27
27
|
expect(page).to have_content("Did you mean")
|
28
|
-
|
28
|
+
click_on 'yehudiyim'
|
29
29
|
within ("#sortAndPerPage") do
|
30
30
|
expect(page).to have_content "1 entry found"
|
31
31
|
end
|
32
32
|
within ("select#search_field") do
|
33
|
-
expect(page).to
|
33
|
+
expect(page).to have_css("option[selected]", text: "Title")
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -41,15 +41,15 @@ RSpec.describe "Did You Mean" do
|
|
41
41
|
it "has suggestions" do
|
42
42
|
# shirma is one letter away from an author word
|
43
43
|
fill_in "q", with: 'shirma'
|
44
|
-
|
44
|
+
click_on 'search'
|
45
45
|
|
46
46
|
expect(page).to have_content("Did you mean")
|
47
|
-
|
47
|
+
click_on 'sharma'
|
48
48
|
within ("#sortAndPerPage") do
|
49
49
|
expect(page).to have_content "1 entry found"
|
50
50
|
end
|
51
51
|
within ("select#search_field") do
|
52
|
-
expect(page).to
|
52
|
+
expect(page).to have_css("option[selected]", text: "Author")
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
@@ -60,15 +60,15 @@ RSpec.describe "Did You Mean" do
|
|
60
60
|
it "has suggestions" do
|
61
61
|
# wome is one letter away from an author word
|
62
62
|
fill_in "q", with: 'wome'
|
63
|
-
|
63
|
+
click_on 'search'
|
64
64
|
|
65
65
|
expect(page).to have_content("Did you mean")
|
66
|
-
|
66
|
+
click_on 'women'
|
67
67
|
within ("#sortAndPerPage") do
|
68
68
|
expect(page).to have_content "1 - 3 of 3"
|
69
69
|
end
|
70
70
|
within ("select#search_field") do
|
71
|
-
expect(page).to
|
71
|
+
expect(page).to have_css("option[selected]", text: "Subject")
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end
|
@@ -76,23 +76,23 @@ RSpec.describe "Did You Mean" do
|
|
76
76
|
describe "a multiword query" do
|
77
77
|
it "does not have suggestions if there are no matches" do
|
78
78
|
fill_in "q", with: 'ooofda ooofda'
|
79
|
-
|
79
|
+
click_on 'search'
|
80
80
|
|
81
|
-
expect(page).
|
81
|
+
expect(page).to have_no_content("Did you mean")
|
82
82
|
end
|
83
83
|
|
84
84
|
it "has separate suggestions" do
|
85
85
|
fill_in "q", with: 'politica boo'
|
86
|
-
|
86
|
+
click_on 'search'
|
87
87
|
|
88
88
|
within(".suggest") do
|
89
89
|
expect(page).to have_content("Did you mean")
|
90
90
|
expect(page).to have_link('policy')
|
91
91
|
expect(page).to have_link('bon')
|
92
|
-
expect(page).
|
92
|
+
expect(page).to have_no_link('policy bon')
|
93
93
|
end
|
94
94
|
|
95
|
-
|
95
|
+
click_on 'bon'
|
96
96
|
within ("#sortAndPerPage") do
|
97
97
|
expect(page).to have_content "1 entry found"
|
98
98
|
end
|
@@ -100,22 +100,22 @@ RSpec.describe "Did You Mean" do
|
|
100
100
|
|
101
101
|
it "ignores repeated terms" do
|
102
102
|
fill_in "q", with: 'boo boo'
|
103
|
-
|
103
|
+
click_on 'search'
|
104
104
|
|
105
105
|
within(".suggest") do
|
106
106
|
expect(page).to have_content("Did you mean")
|
107
107
|
expect(page).to have_link('bon', count: 1)
|
108
|
-
expect(page).
|
108
|
+
expect(page).to have_no_link('bon bon')
|
109
109
|
end
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
113
|
it "shows suggestions if there aren't many hits" do
|
114
114
|
fill_in "q", with: 'ayaz'
|
115
|
-
|
115
|
+
click_on 'search'
|
116
116
|
|
117
117
|
expect(page).to have_content("Did you mean")
|
118
|
-
|
118
|
+
click_on 'bya'
|
119
119
|
within ("#sortAndPerPage") do
|
120
120
|
expect(page).to have_content "1 - 3 of 3"
|
121
121
|
end
|
@@ -124,7 +124,7 @@ RSpec.describe "Did You Mean" do
|
|
124
124
|
it "shows suggestions if at the threshold number" do
|
125
125
|
# polit gives 5 results in 30 record demo index - 5 is default cutoff
|
126
126
|
fill_in "q", with: 'polit'
|
127
|
-
|
127
|
+
click_on 'search'
|
128
128
|
expect(page).to have_content("Did you mean")
|
129
129
|
end
|
130
130
|
|
@@ -139,10 +139,10 @@ RSpec.describe "Did You Mean" do
|
|
139
139
|
|
140
140
|
it "shows suggestions if there aren't many hits" do
|
141
141
|
fill_in "q", with: 'Yoshido Hajime'
|
142
|
-
|
142
|
+
click_on 'search'
|
143
143
|
|
144
144
|
expect(page).to have_content("Did you mean")
|
145
|
-
|
145
|
+
click_on 'yoshida Hajime'
|
146
146
|
within ("#sortAndPerPage") do
|
147
147
|
expect(page).to have_content "1 - 2 of 2"
|
148
148
|
end
|
@@ -14,12 +14,12 @@ RSpec.describe "Facet missing" do
|
|
14
14
|
visit root_path
|
15
15
|
|
16
16
|
within "#facet-subject_geo_ssim" do
|
17
|
-
|
17
|
+
click_on "[Missing]"
|
18
18
|
end
|
19
19
|
|
20
20
|
within "#facet-subject_geo_ssim" do
|
21
|
-
expect(page).to
|
22
|
-
expect(page).to
|
21
|
+
expect(page).to have_css("span.selected", text: "[Missing")
|
22
|
+
expect(page).to have_css("span.facet-count.selected", text: "13")
|
23
23
|
end
|
24
24
|
|
25
25
|
within "#sortAndPerPage" do
|
@@ -36,14 +36,14 @@ RSpec.describe "Facet missing" do
|
|
36
36
|
visit root_path
|
37
37
|
|
38
38
|
within "#facet-subject_geo_ssim" do
|
39
|
-
|
39
|
+
click_on "[Missing]"
|
40
40
|
end
|
41
41
|
|
42
42
|
within "#facet-subject_geo_ssim" do
|
43
|
-
|
43
|
+
click_on "remove"
|
44
44
|
end
|
45
45
|
|
46
|
-
expect(page).
|
46
|
+
expect(page).to have_no_link "remove"
|
47
47
|
expect(page).to have_content("Welcome!")
|
48
48
|
end
|
49
49
|
end
|
@@ -53,14 +53,14 @@ RSpec.describe "Facet missing" do
|
|
53
53
|
visit root_path
|
54
54
|
|
55
55
|
within "#facet-subject_geo_ssim" do
|
56
|
-
|
56
|
+
click_on "[Missing]"
|
57
57
|
end
|
58
58
|
|
59
59
|
within ".filter-subject_geo_ssim" do
|
60
|
-
|
60
|
+
click_on "Remove constraint Region: [Missing]"
|
61
61
|
end
|
62
62
|
|
63
|
-
expect(page).
|
63
|
+
expect(page).to have_no_link "remove"
|
64
64
|
expect(page).to have_content("Welcome!")
|
65
65
|
end
|
66
66
|
end
|
@@ -3,31 +3,31 @@
|
|
3
3
|
RSpec.describe "Facets" do
|
4
4
|
it "shows a single facet's values" do
|
5
5
|
visit facet_catalog_path("language_ssim")
|
6
|
-
expect(page).to
|
7
|
-
expect(page).to
|
6
|
+
expect(page).to have_css ".modal-title", text: "Language"
|
7
|
+
expect(page).to have_css ".facet-select", text: "Tibetan"
|
8
8
|
end
|
9
9
|
|
10
10
|
it "paginates through a facet's values" do
|
11
11
|
visit facet_catalog_path("subject_ssim")
|
12
|
-
expect(page).to
|
12
|
+
expect(page).to have_css '.facet-values li:first', text: "Japanese drama"
|
13
13
|
expect(page).to have_link "A-Z Sort"
|
14
|
-
expect(page).to
|
14
|
+
expect(page).to have_css '.sort-options .active', text: "Numerical Sort"
|
15
15
|
within ".modal-footer" do
|
16
16
|
click_on "Next »"
|
17
17
|
end
|
18
|
-
expect(page).to
|
18
|
+
expect(page).to have_css '.facet-values li:first', text: "Jewish law"
|
19
19
|
expect(page).to have_link "« Previous"
|
20
20
|
end
|
21
21
|
|
22
22
|
it "is able to change the facet sort" do
|
23
23
|
visit facet_catalog_path("subject_ssim")
|
24
|
-
expect(page).to
|
24
|
+
expect(page).to have_css '.facet-values li:first', text: "Japanese drama"
|
25
25
|
within ".modal-footer" do
|
26
26
|
click_on "A-Z Sort"
|
27
27
|
end
|
28
|
-
expect(page).to
|
28
|
+
expect(page).to have_css '.facet-values li:first', text: "Accident insurance"
|
29
29
|
expect(page).to have_link "Numerical Sort"
|
30
|
-
expect(page).to
|
30
|
+
expect(page).to have_css '.sort-options .active', text: "A-Z Sort"
|
31
31
|
end
|
32
32
|
|
33
33
|
it "is able to sort more facet window by letter" do
|
@@ -35,44 +35,44 @@ RSpec.describe "Facets" do
|
|
35
35
|
within ".modal-footer" do
|
36
36
|
click_on "A-Z Sort"
|
37
37
|
end
|
38
|
-
expect(page).to
|
38
|
+
expect(page).to have_css '.facet-values li:first', text: "Accident insurance"
|
39
39
|
expect(page).to have_css '.facet-values li', count: 20
|
40
40
|
click_on 'B'
|
41
|
-
expect(page).to
|
41
|
+
expect(page).to have_css '.facet-values li:first', text: "Buddhism"
|
42
42
|
expect(page).to have_css '.facet-values li', count: 1
|
43
43
|
click_on 'T'
|
44
|
-
expect(page).to
|
44
|
+
expect(page).to have_css '.facet-values li:first', text: "Teaching"
|
45
45
|
expect(page).to have_css '.facet-values li', count: 4
|
46
46
|
click_on 'All'
|
47
|
-
expect(page).to
|
47
|
+
expect(page).to have_css '.facet-values li:first', text: "Accident insurance"
|
48
48
|
expect(page).to have_css '.facet-values li', count: 20
|
49
49
|
find(:css, ".facet-pagination.bottom").click_on "Numerical Sort"
|
50
|
-
expect(page).to
|
50
|
+
expect(page).to have_css '.facet-values li:first', text: "Japanese drama"
|
51
51
|
expect(page).to have_css '.facet-values li', count: 20
|
52
52
|
end
|
53
53
|
|
54
|
-
it 'is able to expand facets when javascript is enabled', js
|
54
|
+
it 'is able to expand facets when javascript is enabled', :js do
|
55
55
|
visit root_path
|
56
56
|
|
57
57
|
expect(page).to have_css('#facet-format', visible: false)
|
58
58
|
|
59
|
-
|
59
|
+
click_on 'Format'
|
60
60
|
|
61
61
|
sleep(1) # let facet animation finish and wait for it to potentially re-collapse
|
62
62
|
|
63
63
|
expect(page).to have_css('#facet-format', visible: true) # assert that it didn't re-collapse
|
64
64
|
end
|
65
65
|
|
66
|
-
it 'is able to expand pivot facets when javascript is enabled', js
|
66
|
+
it 'is able to expand pivot facets when javascript is enabled', :js do
|
67
67
|
visit root_path
|
68
68
|
|
69
|
-
|
69
|
+
click_on 'Pivot Field'
|
70
70
|
|
71
71
|
within '#facet-example_pivot_field' do
|
72
72
|
expect(page).to have_css('.facet-leaf-node', text: "Book 30", normalize_ws: true)
|
73
|
-
expect(page).
|
73
|
+
expect(page).to have_no_css('.facet-select', text: 'Tibetan')
|
74
74
|
page.find('.facet-toggle-handle').click
|
75
|
-
|
75
|
+
click_on 'Tibetan'
|
76
76
|
end
|
77
77
|
|
78
78
|
expect(page).to have_css('.constraint-value', text: 'Format Book')
|
@@ -83,7 +83,8 @@ RSpec.describe "Facets" do
|
|
83
83
|
it 'changes to the button on button click in Firefox' do
|
84
84
|
pending 'Capybara::NotSupportedByDriverError: Capybara::Driver::Base#evaluate_script'
|
85
85
|
visit root_path
|
86
|
-
|
86
|
+
click_on 'Format'
|
87
|
+
|
87
88
|
focused_element_data_target = page.evaluate_script("document.activeElement")['data-bs-target']
|
88
89
|
expect(focused_element_data_target).to eq '#facet-format'
|
89
90
|
end
|
data/spec/features/modal_spec.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
RSpec.describe 'Modal' do
|
4
|
-
it 'can open and dismiss the email modal', js
|
4
|
+
it 'can open and dismiss the email modal', :js do
|
5
5
|
visit solr_document_path('2007020969')
|
6
6
|
expect(page).to have_no_selector 'dialog#blacklight-modal'
|
7
|
-
|
8
|
-
expect(page).to
|
9
|
-
|
7
|
+
click_on 'Email'
|
8
|
+
expect(page).to have_css 'dialog#blacklight-modal'
|
9
|
+
click_on '×'
|
10
10
|
expect(page).to have_no_selector 'dialog#blacklight-modal'
|
11
11
|
end
|
12
12
|
end
|
@@ -15,13 +15,13 @@ RSpec.describe "Record View" do
|
|
15
15
|
expect(page).to have_content "E99.D2 H437 2008"
|
16
16
|
tmp_value = Capybara.ignore_hidden_elements
|
17
17
|
Capybara.ignore_hidden_elements = false
|
18
|
-
expect(page).to
|
18
|
+
expect(page).to have_css("link[rel=alternate]")
|
19
19
|
Capybara.ignore_hidden_elements = tmp_value
|
20
20
|
end
|
21
21
|
|
22
22
|
it "does not display blank titles" do
|
23
23
|
visit solr_document_path('2008305903')
|
24
|
-
expect(page).
|
24
|
+
expect(page).to have_no_content "More Information:"
|
25
25
|
end
|
26
26
|
|
27
27
|
it "does not display vernacular records" do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
RSpec.describe "Search Results context" do
|
4
|
-
it "passes the current search id through", js
|
4
|
+
it "passes the current search id through", :js do
|
5
5
|
search_for ''
|
6
6
|
click_on 'Pluvial nectar of blessings'
|
7
7
|
search_id = Search.last.id.to_s
|
@@ -16,11 +16,11 @@ RSpec.describe "Search Results context" do
|
|
16
16
|
expect(prev['data-context-href']).to eq "/catalog/2004310986/track?counter=8&document_id=2004310986&search_id=#{search_id}"
|
17
17
|
end
|
18
18
|
|
19
|
-
it "redirects context urls to the original url", js
|
19
|
+
it "redirects context urls to the original url", :js do
|
20
20
|
search_for ''
|
21
21
|
first('.index_title a').click
|
22
22
|
expect(page).to have_content "« Previous | 1 of 30 | Next »"
|
23
|
-
expect(page.current_url).
|
23
|
+
expect(page.current_url).to have_no_content "/track"
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'shows "Back to Search" and "Start Over links"' do
|
@@ -38,12 +38,12 @@ RSpec.describe "Search Results context" do
|
|
38
38
|
|
39
39
|
# Go to the number 9 result separately
|
40
40
|
visit '/catalog/2003546302'
|
41
|
-
expect(page).
|
42
|
-
expect(page).
|
41
|
+
expect(page).to have_no_css '.page-links'
|
42
|
+
expect(page).to have_no_content "« Previous | 10 of 30 | Next »"
|
43
43
|
end
|
44
44
|
|
45
45
|
context "navigating between search results using context pagination" do
|
46
|
-
it "updates the back to search link with the current search pagination context", js
|
46
|
+
it "updates the back to search link with the current search pagination context", :js do
|
47
47
|
search_for ''
|
48
48
|
expect(page).to have_content "1 - 10"
|
49
49
|
find_all('.index_title a').last.click
|
@@ -2,27 +2,27 @@
|
|
2
2
|
|
3
3
|
RSpec.describe "Search History Page" do
|
4
4
|
describe "crawler search" do
|
5
|
-
let(:original_proc) {
|
5
|
+
let(:original_proc) { CatalogController.blacklight_config.crawler_detector }
|
6
6
|
|
7
7
|
before do
|
8
|
-
|
8
|
+
CatalogController.blacklight_config.crawler_detector = ->(req) { req.env['HTTP_USER_AGENT'] =~ /Googlebot/ }
|
9
9
|
end
|
10
10
|
|
11
11
|
after do
|
12
|
-
|
12
|
+
CatalogController.blacklight_config.crawler_detector = original_proc
|
13
13
|
end
|
14
14
|
|
15
15
|
it "remembers human searches" do
|
16
16
|
visit root_path
|
17
17
|
fill_in "q", with: 'chicken'
|
18
|
-
expect {
|
18
|
+
expect { click_on 'search' }.to change(Search, :count).by(1)
|
19
19
|
end
|
20
20
|
|
21
21
|
it "doesn't remember bot searches" do
|
22
22
|
page.driver.header('User-Agent', 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)')
|
23
23
|
visit root_path
|
24
24
|
fill_in "q", with: 'chicken'
|
25
|
-
expect {
|
25
|
+
expect { click_on 'search' }.not_to change(Search, :count)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|