blacklight 7.19.2 → 7.21.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.babelrc +11 -0
- data/.env +1 -1
- data/.github/workflows/ruby.yml +21 -3
- data/.rubocop.yml +4 -0
- data/Gemfile +1 -1
- data/README.md +2 -2
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +50 -27
- data/app/assets/stylesheets/blacklight/_constraints.scss +7 -4
- data/app/assets/stylesheets/blacklight/_controls.scss +8 -0
- data/app/assets/stylesheets/blacklight/_facets.scss +2 -2
- data/app/assets/stylesheets/blacklight/_pagination.scss +1 -1
- data/app/assets/stylesheets/blacklight/_twitter_typeahead.scss +1 -0
- data/app/components/blacklight/constraints_component.rb +1 -1
- data/app/components/blacklight/document_component.rb +4 -4
- data/app/components/blacklight/facet_item_component.rb +2 -2
- data/app/components/blacklight/metadata_field_layout_component.rb +1 -1
- data/app/components/blacklight/response/pagination_component.html.erb +1 -1
- data/app/components/blacklight/system/modal_component.html.erb +2 -2
- data/app/controllers/concerns/blacklight/bookmarks.rb +0 -3
- data/app/controllers/concerns/blacklight/catalog.rb +5 -2
- data/app/controllers/concerns/blacklight/controller.rb +9 -5
- data/app/controllers/concerns/blacklight/search_context.rb +1 -1
- data/app/helpers/blacklight/catalog_helper_behavior.rb +1 -3
- data/app/javascript/blacklight/core.js +14 -3
- data/app/javascript/blacklight/modal.js +1 -1
- data/app/javascript/blacklight/search_context.js +5 -2
- data/app/models/concerns/blacklight/document/email.rb +18 -6
- data/app/models/concerns/blacklight/document/sms.rb +16 -4
- data/app/models/record_mailer.rb +9 -1
- data/app/presenters/blacklight/facet_item_presenter.rb +2 -0
- data/app/views/catalog/_home_text.html.erb +2 -2
- data/app/views/catalog/_paginate_compact.html.erb +1 -0
- data/app/views/record_mailer/sms_record.text.erb +1 -1
- data/app/views/shared/_header_navbar.html.erb +2 -2
- data/blacklight.gemspec +4 -2
- data/config/locales/blacklight.de.yml +4 -2
- data/config/locales/blacklight.en.yml +6 -2
- data/config/locales/blacklight.es.yml +3 -1
- data/config/locales/blacklight.fr.yml +3 -1
- data/config/locales/blacklight.it.yml +3 -1
- data/lib/blacklight/configuration.rb +9 -0
- data/lib/blacklight/engine.rb +2 -0
- data/lib/blacklight/search_state/filter_field.rb +35 -11
- data/lib/blacklight/solr/response/facets.rb +2 -1
- data/lib/blacklight/solr/response/group_response.rb +3 -2
- data/lib/blacklight/solr/response/pagination_methods.rb +1 -1
- data/lib/blacklight/solr/search_builder_behavior.rb +2 -0
- data/lib/blacklight.rb +5 -1
- data/lib/generators/blacklight/assets_generator.rb +4 -2
- data/lib/generators/blacklight/install_generator.rb +4 -1
- data/lib/generators/blacklight/user_generator.rb +1 -1
- data/package.json +5 -3
- data/spec/components/blacklight/facet_item_component_spec.rb +6 -2
- data/spec/controllers/catalog_controller_spec.rb +14 -2
- data/spec/features/axe_spec.rb +33 -0
- data/spec/features/facet_missing_spec.rb +67 -0
- data/spec/features/facets_spec.rb +1 -1
- data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +2 -2
- data/spec/lib/blacklight/search_state/filter_field_spec.rb +13 -0
- data/spec/models/blacklight/configuration_spec.rb +92 -0
- data/spec/models/blacklight/document/email_spec.rb +32 -0
- data/spec/models/blacklight/document/sms_spec.rb +33 -0
- data/spec/models/blacklight/solr/response/facets_spec.rb +1 -1
- data/spec/models/blacklight/solr/response/group_response_spec.rb +3 -2
- data/spec/models/record_mailer_spec.rb +30 -2
- data/spec/spec_helper.rb +18 -12
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -3
- metadata +44 -11
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe "Facet missing" do
|
4
|
+
before do
|
5
|
+
CatalogController.blacklight_config[:default_solr_params]["facet.missing"] = true
|
6
|
+
end
|
7
|
+
|
8
|
+
after do
|
9
|
+
CatalogController.blacklight_config[:default_solr_params].delete("facet.missing")
|
10
|
+
end
|
11
|
+
|
12
|
+
context "selecting missing field in facets" do
|
13
|
+
it "adds facet missing query and constraints" do
|
14
|
+
visit root_path
|
15
|
+
|
16
|
+
within "#facet-subject_geo_ssim" do
|
17
|
+
click_link "[Missing]"
|
18
|
+
end
|
19
|
+
|
20
|
+
within "#facet-subject_geo_ssim" do
|
21
|
+
expect(page).to have_selector("span.selected", text: "[Missing")
|
22
|
+
expect(page).to have_selector("span.facet-count.selected", text: "13")
|
23
|
+
end
|
24
|
+
|
25
|
+
within "#sortAndPerPage" do
|
26
|
+
expect(page).to have_content "1 - 10 of 13"
|
27
|
+
end
|
28
|
+
|
29
|
+
expect(page).to have_css(".constraint-value", text: "Region")
|
30
|
+
expect(page).to have_css(".constraint-value", text: "[Missing]")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
context "unselecting the facet missing facet" do
|
35
|
+
it "unselects the missing field facet" do
|
36
|
+
visit root_path
|
37
|
+
|
38
|
+
within "#facet-subject_geo_ssim" do
|
39
|
+
click_link "[Missing]"
|
40
|
+
end
|
41
|
+
|
42
|
+
within "#facet-subject_geo_ssim" do
|
43
|
+
click_link "remove"
|
44
|
+
end
|
45
|
+
|
46
|
+
expect(page).not_to have_link "remove"
|
47
|
+
expect(page).to have_content("Welcome!")
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
context "unselecting the facet missing constraint" do
|
52
|
+
it "unselects the missing field facet" do
|
53
|
+
visit root_path
|
54
|
+
|
55
|
+
within "#facet-subject_geo_ssim" do
|
56
|
+
click_link "[Missing]"
|
57
|
+
end
|
58
|
+
|
59
|
+
within ".filter-subject_geo_ssim" do
|
60
|
+
click_link "Remove constraint Region: [Missing]"
|
61
|
+
end
|
62
|
+
|
63
|
+
expect(page).not_to have_link "remove"
|
64
|
+
expect(page).to have_content("Welcome!")
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -69,7 +69,7 @@ RSpec.describe "Facets" do
|
|
69
69
|
page.find('h3.facet-field-heading button', text: 'Pivot Field').click
|
70
70
|
|
71
71
|
within '#facet-example_pivot_field' do
|
72
|
-
expect(page).to have_css('.facet-leaf-node', text: "Book
|
72
|
+
expect(page).to have_css('.facet-leaf-node', text: "Book 30")
|
73
73
|
expect(page).not_to have_css('.facet-select', text: 'Tibetan')
|
74
74
|
page.find('.facet-toggle-handle').click
|
75
75
|
click_link 'Tibetan'
|
@@ -314,7 +314,7 @@ RSpec.describe Blacklight::FacetsHelperBehavior do
|
|
314
314
|
end
|
315
315
|
|
316
316
|
describe "simple case" do
|
317
|
-
let(:expected_html) { '<span class="facet-label"><a class="facet-select" href="/catalog">Z</a></span><span class="facet-count">10</span>' }
|
317
|
+
let(:expected_html) { '<span class="facet-label"><a class="facet-select" rel="nofollow" href="/catalog">Z</a></span><span class="facet-count">10</span>' }
|
318
318
|
|
319
319
|
it "uses facet_display_value" do
|
320
320
|
result = helper.render_facet_value('simple_field', item)
|
@@ -323,7 +323,7 @@ RSpec.describe Blacklight::FacetsHelperBehavior do
|
|
323
323
|
end
|
324
324
|
|
325
325
|
describe "when :url_method is set" do
|
326
|
-
let(:expected_html) { '<span class="facet-label"><a class="facet-select" href="/blabla">Z</a></span><span class="facet-count">10</span>' }
|
326
|
+
let(:expected_html) { '<span class="facet-label"><a class="facet-select" rel="nofollow" href="/blabla">Z</a></span><span class="facet-count">10</span>' }
|
327
327
|
|
328
328
|
it "uses that method" do
|
329
329
|
allow(helper).to receive(:facet_configuration_for_field).with('simple_field').and_return(Blacklight::Configuration::FacetField.new(key: 'simple_field', query: nil, date: nil, helper_method: nil, single: false, url_method: :test_method))
|
@@ -159,6 +159,19 @@ RSpec.describe Blacklight::SearchState::FilterField do
|
|
159
159
|
expect(new_state.filter('another_field').values).to eq ['3']
|
160
160
|
end
|
161
161
|
end
|
162
|
+
|
163
|
+
context "With facet.missing field" do
|
164
|
+
let(:params) do
|
165
|
+
{ f: { "-some_field": ["[* TO *]"] } }
|
166
|
+
end
|
167
|
+
|
168
|
+
it "removes facet.missing facet params" do
|
169
|
+
filter = search_state.filter("some_field")
|
170
|
+
new_state = filter.remove(OpenStruct.new(key: 'some_field', missing: true))
|
171
|
+
|
172
|
+
expect(new_state.params).to eq({})
|
173
|
+
end
|
174
|
+
end
|
162
175
|
end
|
163
176
|
|
164
177
|
describe '#values' do
|
@@ -543,6 +543,98 @@ RSpec.describe "Blacklight::Configuration", api: true do
|
|
543
543
|
end
|
544
544
|
end
|
545
545
|
|
546
|
+
describe "add_sms_field" do
|
547
|
+
it "takes hash form" do
|
548
|
+
config.add_sms_field("title_tsim", label: "Title")
|
549
|
+
|
550
|
+
expect(config.sms_fields["title_tsim"]).not_to be_nil
|
551
|
+
expect(config.sms_fields["title_tsim"].label).to eq "Title"
|
552
|
+
end
|
553
|
+
|
554
|
+
it "takes ShowField argument" do
|
555
|
+
config.add_sms_field("title_tsim", Blacklight::Configuration::SmsField.new(field: "title_display", label: "Title"))
|
556
|
+
|
557
|
+
expect(config.sms_fields["title_tsim"]).not_to be_nil
|
558
|
+
expect(config.sms_fields["title_tsim"].label).to eq "Title"
|
559
|
+
end
|
560
|
+
|
561
|
+
it "takes block form" do
|
562
|
+
config.add_sms_field("title_tsim") do |f|
|
563
|
+
f.label = "Title"
|
564
|
+
end
|
565
|
+
|
566
|
+
expect(config.sms_fields["title_tsim"]).not_to be_nil
|
567
|
+
expect(config.sms_fields["title_tsim"].label).to eq "Title"
|
568
|
+
end
|
569
|
+
|
570
|
+
it "creates default label humanized from field" do
|
571
|
+
config.add_sms_field("my_custom_field")
|
572
|
+
|
573
|
+
expect(config.sms_fields["my_custom_field"].label).to eq "My Custom Field"
|
574
|
+
end
|
575
|
+
|
576
|
+
it "raises on nil solr field name" do
|
577
|
+
expect { config.add_sms_field(nil) }.to raise_error ArgumentError
|
578
|
+
end
|
579
|
+
|
580
|
+
it "takes wild-carded field names and dereference them to solr fields" do
|
581
|
+
allow(config).to receive(:reflected_fields).and_return(
|
582
|
+
"some_field_display" => {},
|
583
|
+
"another_field_display" => {},
|
584
|
+
"a_facet_field" => {}
|
585
|
+
)
|
586
|
+
config.add_sms_field "*_display"
|
587
|
+
|
588
|
+
expect(config.sms_fields.keys).to eq %w[some_field_display another_field_display]
|
589
|
+
end
|
590
|
+
end
|
591
|
+
|
592
|
+
describe "add_email_field" do
|
593
|
+
it "takes hash form" do
|
594
|
+
config.add_email_field("title_tsim", label: "Title")
|
595
|
+
|
596
|
+
expect(config.email_fields["title_tsim"]).not_to be_nil
|
597
|
+
expect(config.email_fields["title_tsim"].label).to eq "Title"
|
598
|
+
end
|
599
|
+
|
600
|
+
it "takes ShowField argument" do
|
601
|
+
config.add_email_field("title_tsim", Blacklight::Configuration::EmailField.new(field: "title_display", label: "Title"))
|
602
|
+
|
603
|
+
expect(config.email_fields["title_tsim"]).not_to be_nil
|
604
|
+
expect(config.email_fields["title_tsim"].label).to eq "Title"
|
605
|
+
end
|
606
|
+
|
607
|
+
it "takes block form" do
|
608
|
+
config.add_email_field("title_tsim") do |f|
|
609
|
+
f.label = "Title"
|
610
|
+
end
|
611
|
+
|
612
|
+
expect(config.email_fields["title_tsim"]).not_to be_nil
|
613
|
+
expect(config.email_fields["title_tsim"].label).to eq "Title"
|
614
|
+
end
|
615
|
+
|
616
|
+
it "creates default label humanized from field" do
|
617
|
+
config.add_email_field("my_custom_field")
|
618
|
+
|
619
|
+
expect(config.email_fields["my_custom_field"].label).to eq "My Custom Field"
|
620
|
+
end
|
621
|
+
|
622
|
+
it "raises on nil solr field name" do
|
623
|
+
expect { config.add_email_field(nil) }.to raise_error ArgumentError
|
624
|
+
end
|
625
|
+
|
626
|
+
it "takes wild-carded field names and dereference them to solr fields" do
|
627
|
+
allow(config).to receive(:reflected_fields).and_return(
|
628
|
+
"some_field_display" => {},
|
629
|
+
"another_field_display" => {},
|
630
|
+
"a_facet_field" => {}
|
631
|
+
)
|
632
|
+
config.add_email_field "*_display"
|
633
|
+
|
634
|
+
expect(config.email_fields.keys).to eq %w[some_field_display another_field_display]
|
635
|
+
end
|
636
|
+
end
|
637
|
+
|
546
638
|
describe "#default_search_field" do
|
547
639
|
it "uses the field with a :default key" do
|
548
640
|
config.add_search_field('search_field_1')
|
@@ -1,6 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
RSpec.describe "Blacklight::Document::Email" do
|
4
|
+
let(:config) do
|
5
|
+
Blacklight::Configuration.new
|
6
|
+
end
|
7
|
+
|
4
8
|
before(:all) do
|
5
9
|
SolrDocument.use_extension(Blacklight::Document::Email)
|
6
10
|
end
|
@@ -22,4 +26,32 @@ RSpec.describe "Blacklight::Document::Email" do
|
|
22
26
|
doc = SolrDocument.new(id: "1234")
|
23
27
|
expect(doc.to_email_text).to be_nil
|
24
28
|
end
|
29
|
+
|
30
|
+
context "we pass in configuration with email fields set" do
|
31
|
+
it "uses the email fields for to_email_text" do
|
32
|
+
config.add_email_field("foo", label: "Foo:")
|
33
|
+
config.add_email_field("bar", label: "Bar:")
|
34
|
+
doc = SolrDocument.new(id: "1234", foo: ["Fuzz Fuzz", "Fizz Fizz"], bar: ["Buzz Buzz", "Bizz Bizz"])
|
35
|
+
|
36
|
+
expect(doc.to_email_text(config)).to eq("Foo: Fuzz Fuzz Fizz Fizz\nBar: Buzz Buzz Bizz Bizz")
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
context "we pass in configuration with email fields no set" do
|
41
|
+
it "falls back on default semantics setup" do
|
42
|
+
doc = SolrDocument.new(id: "1234", title_tsim: ["My Title", "My Alt. Title"])
|
43
|
+
email_body = doc.to_email_text(config)
|
44
|
+
expect(email_body).to match(/Title: My Title/)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
context "document field is single valued" do
|
49
|
+
it "handles the single value field correctly" do
|
50
|
+
config.add_email_field("foo", label: "Foo:")
|
51
|
+
config.add_email_field("bar", label: "Bar:")
|
52
|
+
doc = SolrDocument.new(id: "1234", foo: "Fuzz Fuzz", bar: ["Buzz Buzz", "Bizz Bizz"])
|
53
|
+
|
54
|
+
expect(doc.to_email_text(config)).to eq("Foo: Fuzz Fuzz\nBar: Buzz Buzz Bizz Bizz")
|
55
|
+
end
|
56
|
+
end
|
25
57
|
end
|
@@ -1,6 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
RSpec.describe "Blacklight::Document::Email" do
|
4
|
+
let(:config) do
|
5
|
+
Blacklight::Configuration.new
|
6
|
+
end
|
7
|
+
|
4
8
|
before(:all) do
|
5
9
|
SolrDocument.use_extension(Blacklight::Document::Sms)
|
6
10
|
end
|
@@ -22,4 +26,33 @@ RSpec.describe "Blacklight::Document::Email" do
|
|
22
26
|
doc = SolrDocument.new(id: "1234")
|
23
27
|
expect(doc.to_sms_text).to be_nil
|
24
28
|
end
|
29
|
+
|
30
|
+
context "we pass in configuration with sms fields set" do
|
31
|
+
it "uses the sms fields for to_sms_text" do
|
32
|
+
config.add_sms_field("foo", label: "Foo:")
|
33
|
+
config.add_sms_field("bar", label: " by")
|
34
|
+
doc = SolrDocument.new(id: "1234", foo: ["Fuzz Fuzz", "Fizz Fizz"], bar: ["Buzz Buzz", "Bizz Bizz"])
|
35
|
+
|
36
|
+
expect(doc.to_sms_text(config)).to eq("Foo: Fuzz Fuzz by Buzz Buzz")
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
context "we pass in configuration with sms fields no set" do
|
41
|
+
it "falls back on default semantics setup" do
|
42
|
+
doc = SolrDocument.new(id: "1234", title_tsim: ["My Title", "My Alt. Title"])
|
43
|
+
sms_text = doc.to_sms_text(config)
|
44
|
+
expect(sms_text).to match(/My Title/)
|
45
|
+
expect(sms_text).not_to match(/My Alt\. Title/)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
context "document field is single valued" do
|
50
|
+
it "handles the single value field correctly" do
|
51
|
+
config.add_sms_field("foo", label: "Foo:")
|
52
|
+
config.add_sms_field("bar", label: " by")
|
53
|
+
doc = SolrDocument.new(id: "1234", foo: "Fuzz Fuzz", bar: ["Buzz Buzz", "Bizz Bizz"])
|
54
|
+
|
55
|
+
expect(doc.to_sms_text(config)).to eq("Foo: Fuzz Fuzz by Buzz Buzz")
|
56
|
+
end
|
57
|
+
end
|
25
58
|
end
|
@@ -155,7 +155,7 @@ RSpec.describe Blacklight::Solr::Response::Facets, api: true do
|
|
155
155
|
end
|
156
156
|
|
157
157
|
it "marks the facet.missing field with a human-readable label and fq" do
|
158
|
-
missing = subject.aggregations["some_field"].items.find
|
158
|
+
missing = subject.aggregations["some_field"].items.find(&:missing)
|
159
159
|
|
160
160
|
expect(missing.label).to eq "[Missing]"
|
161
161
|
expect(missing.fq).to eq "-some_field:[* TO *]"
|
@@ -69,8 +69,9 @@ RSpec.describe Blacklight::Solr::Response::GroupResponse, api: true do
|
|
69
69
|
it "accesses a custom field grouped i18n key" do
|
70
70
|
allow(I18n).to receive(:t).with(
|
71
71
|
'blacklight.entry_name.grouped.result_group_ssi',
|
72
|
-
default: :'blacklight.entry_name.grouped.default'
|
73
|
-
|
72
|
+
default: :'blacklight.entry_name.grouped.default',
|
73
|
+
count: 2
|
74
|
+
).and_return('cool groups')
|
74
75
|
expect(group.entry_name(count: 2)).to eq 'cool groups'
|
75
76
|
end
|
76
77
|
|
@@ -1,17 +1,24 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
RSpec.describe RecordMailer do
|
4
|
+
let(:config) do
|
5
|
+
Blacklight::Configuration.new
|
6
|
+
end
|
7
|
+
|
8
|
+
let(:document) do
|
9
|
+
SolrDocument.new(id: "123456", format: ["book"], title_tsim: "The horn", language_ssim: "English", author_tsim: "Janetzky, Kurt")
|
10
|
+
end
|
11
|
+
|
4
12
|
before do
|
5
13
|
allow(described_class).to receive(:default).and_return(from: 'no-reply@projectblacklight.org')
|
6
14
|
SolrDocument.use_extension(Blacklight::Document::Email)
|
7
15
|
SolrDocument.use_extension(Blacklight::Document::Sms)
|
8
|
-
document = SolrDocument.new(id: "123456", format: ["book"], title_tsim: "The horn", language_ssim: "English", author_tsim: "Janetzky, Kurt")
|
9
16
|
@documents = [document]
|
10
17
|
end
|
11
18
|
|
12
19
|
describe "email" do
|
13
20
|
before do
|
14
|
-
details = { to: 'test@test.com', message: "This is my message" }
|
21
|
+
details = { to: 'test@test.com', message: "This is my message", config: config }
|
15
22
|
@email = described_class.email_record(@documents, details, host: 'projectblacklight.org', protocol: 'https')
|
16
23
|
end
|
17
24
|
|
@@ -42,6 +49,27 @@ RSpec.describe RecordMailer do
|
|
42
49
|
@https_email = described_class.email_record(@documents, details, host: 'projectblacklight.org', protocol: 'https')
|
43
50
|
expect(@https_email.body).to match %r{https://projectblacklight.org/}
|
44
51
|
end
|
52
|
+
|
53
|
+
context "email title_field is configured and multi valued" do
|
54
|
+
let(:document) { SolrDocument.new(id: "123456", foo: ["Fizz Fizz", "Fuzz Fuzz"], format: ["book"], title_tsim: "The horn", language_ssim: "English", author_tsim: "Janetzky, Kurt") }
|
55
|
+
|
56
|
+
it "uses configured email title_field" do
|
57
|
+
config.email.title_field = "foo"
|
58
|
+
expect(@email.subject).to match("Fizz Fizz")
|
59
|
+
expect(@email.subject).not_to match("Fuzz Fuzz")
|
60
|
+
expect(@email.subject).not_to match("The horn")
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
context "email title_field is configured and single valued" do
|
65
|
+
let(:document) { SolrDocument.new(id: "123456", foo: "Fizz Fizz", format: ["book"], title_tsim: "The horn", language_ssim: "English", author_tsim: "Janetzky, Kurt") }
|
66
|
+
|
67
|
+
it "uses configured email title_field" do
|
68
|
+
config.email.title_field = "foo"
|
69
|
+
expect(@email.subject).to match("Fizz Fizz")
|
70
|
+
expect(@email.subject).not_to match("The horn")
|
71
|
+
end
|
72
|
+
end
|
45
73
|
end
|
46
74
|
|
47
75
|
describe "SMS" do
|
data/spec/spec_helper.rb
CHANGED
@@ -10,27 +10,33 @@ SimpleCov.start do
|
|
10
10
|
add_filter "/spec/"
|
11
11
|
end
|
12
12
|
|
13
|
-
require 'rsolr'
|
14
|
-
require 'blacklight'
|
15
|
-
|
16
13
|
require 'engine_cart'
|
17
14
|
EngineCart.load_application!
|
18
15
|
|
19
16
|
require 'rspec/rails'
|
20
17
|
require 'rspec/its'
|
21
18
|
require 'rspec/collection_matchers'
|
22
|
-
require 'capybara/
|
23
|
-
require '
|
19
|
+
require 'capybara/rails'
|
20
|
+
require 'webdrivers'
|
21
|
+
require 'selenium-webdriver'
|
24
22
|
require 'equivalent-xml'
|
23
|
+
require 'axe-rspec'
|
24
|
+
|
25
|
+
require 'rsolr'
|
26
|
+
require 'blacklight'
|
25
27
|
|
26
|
-
Capybara.javascript_driver = :
|
27
|
-
Capybara.disable_animation = true
|
28
|
-
# Capybara.enable_aria_label = true
|
28
|
+
Capybara.javascript_driver = :headless_chrome
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
Capybara.register_driver :headless_chrome do |app|
|
31
|
+
Capybara::Selenium::Driver.load_selenium
|
32
|
+
browser_options = ::Selenium::WebDriver::Chrome::Options.new.tap do |opts|
|
33
|
+
opts.args << '--headless'
|
34
|
+
opts.args << '--disable-gpu'
|
35
|
+
opts.args << '--no-sandbox'
|
36
|
+
opts.args << '--window-size=1280,1696'
|
37
|
+
end
|
38
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options)
|
39
|
+
end
|
34
40
|
|
35
41
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
36
42
|
# in spec/support/ and its subdirectories.
|
@@ -17,9 +17,6 @@ class TestAppGenerator < Rails::Generators::Base
|
|
17
17
|
options = '--devise'
|
18
18
|
if ENV['BLACKLIGHT_API_TEST']
|
19
19
|
options += ' --skip-assets'
|
20
|
-
inject_into_class 'app/controllers/application_controller.rb', 'ApplicationController' do
|
21
|
-
" include ActionController::MimeResponds\n" # see https://github.com/projectblacklight/blacklight/issues/1894
|
22
|
-
end
|
23
20
|
end
|
24
21
|
|
25
22
|
generate 'blacklight:install', options
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.21.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -14,10 +14,10 @@ authors:
|
|
14
14
|
- Dan Funk
|
15
15
|
- Naomi Dushay
|
16
16
|
- Justin Coyne
|
17
|
-
autorequire:
|
17
|
+
autorequire:
|
18
18
|
bindir: exe
|
19
19
|
cert_chain: []
|
20
|
-
date: 2021-
|
20
|
+
date: 2021-11-19 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|
@@ -127,16 +127,16 @@ dependencies:
|
|
127
127
|
name: view_component
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
|
-
- - "
|
130
|
+
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: 2.
|
132
|
+
version: '2.42'
|
133
133
|
type: :runtime
|
134
134
|
prerelease: false
|
135
135
|
version_requirements: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
|
-
- - "
|
137
|
+
- - "~>"
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version: 2.
|
139
|
+
version: '2.42'
|
140
140
|
- !ruby/object:Gem::Dependency
|
141
141
|
name: rsolr
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|
@@ -199,6 +199,20 @@ dependencies:
|
|
199
199
|
- - ">="
|
200
200
|
- !ruby/object:Gem::Version
|
201
201
|
version: '1.0'
|
202
|
+
- !ruby/object:Gem::Dependency
|
203
|
+
name: axe-core-rspec
|
204
|
+
requirement: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
type: :development
|
210
|
+
prerelease: false
|
211
|
+
version_requirements: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
202
216
|
- !ruby/object:Gem::Dependency
|
203
217
|
name: capybara
|
204
218
|
requirement: !ruby/object:Gem::Requirement
|
@@ -214,7 +228,21 @@ dependencies:
|
|
214
228
|
- !ruby/object:Gem::Version
|
215
229
|
version: '3'
|
216
230
|
- !ruby/object:Gem::Dependency
|
217
|
-
name:
|
231
|
+
name: webdrivers
|
232
|
+
requirement: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
237
|
+
type: :development
|
238
|
+
prerelease: false
|
239
|
+
version_requirements: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - ">="
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '0'
|
244
|
+
- !ruby/object:Gem::Dependency
|
245
|
+
name: selenium-webdriver
|
218
246
|
requirement: !ruby/object:Gem::Requirement
|
219
247
|
requirements:
|
220
248
|
- - ">="
|
@@ -350,6 +378,7 @@ executables: []
|
|
350
378
|
extensions: []
|
351
379
|
extra_rdoc_files: []
|
352
380
|
files:
|
381
|
+
- ".babelrc"
|
353
382
|
- ".docker/app/Dockerfile"
|
354
383
|
- ".docker/app/entrypoint.sh"
|
355
384
|
- ".env"
|
@@ -762,8 +791,10 @@ files:
|
|
762
791
|
- spec/features/advanced_search_spec.rb
|
763
792
|
- spec/features/alternate_controller_spec.rb
|
764
793
|
- spec/features/autocomplete_spec.rb
|
794
|
+
- spec/features/axe_spec.rb
|
765
795
|
- spec/features/bookmarks_spec.rb
|
766
796
|
- spec/features/did_you_mean_spec.rb
|
797
|
+
- spec/features/facet_missing_spec.rb
|
767
798
|
- spec/features/facets_spec.rb
|
768
799
|
- spec/features/record_view_spec.rb
|
769
800
|
- spec/features/search_context_spec.rb
|
@@ -888,7 +919,7 @@ homepage: http://projectblacklight.org/
|
|
888
919
|
licenses:
|
889
920
|
- Apache 2.0
|
890
921
|
metadata: {}
|
891
|
-
post_install_message:
|
922
|
+
post_install_message:
|
892
923
|
rdoc_options: []
|
893
924
|
require_paths:
|
894
925
|
- lib
|
@@ -903,8 +934,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
903
934
|
- !ruby/object:Gem::Version
|
904
935
|
version: '0'
|
905
936
|
requirements: []
|
906
|
-
rubygems_version: 3.
|
907
|
-
signing_key:
|
937
|
+
rubygems_version: 3.1.4
|
938
|
+
signing_key:
|
908
939
|
specification_version: 4
|
909
940
|
summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)
|
910
941
|
index.
|
@@ -934,8 +965,10 @@ test_files:
|
|
934
965
|
- spec/features/advanced_search_spec.rb
|
935
966
|
- spec/features/alternate_controller_spec.rb
|
936
967
|
- spec/features/autocomplete_spec.rb
|
968
|
+
- spec/features/axe_spec.rb
|
937
969
|
- spec/features/bookmarks_spec.rb
|
938
970
|
- spec/features/did_you_mean_spec.rb
|
971
|
+
- spec/features/facet_missing_spec.rb
|
939
972
|
- spec/features/facets_spec.rb
|
940
973
|
- spec/features/record_view_spec.rb
|
941
974
|
- spec/features/search_context_spec.rb
|