From 3ecd0855fe9b821c6ce421e85db67bfa91541ab8 Mon Sep 17 00:00:00 2001 From: Carolyn Cole Date: Tue, 5 Mar 2024 15:25:48 -0500 Subject: [PATCH 1/2] Adding year_available_itsi to pdc describe indexing configuration This allows the publisj date to be part of the facet and removes the [missing] from the page --- lib/traject/pdc_describe_indexing_config.rb | 2 ++ spec/system/search_pdc_results_page_spec.rb | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/lib/traject/pdc_describe_indexing_config.rb b/lib/traject/pdc_describe_indexing_config.rb index bd86a7af..93c144c7 100644 --- a/lib/traject/pdc_describe_indexing_config.rb +++ b/lib/traject/pdc_describe_indexing_config.rb @@ -144,6 +144,8 @@ to_field 'issue_date_ssim', extract_xpath("/hash/resource/publication-year") +to_field 'year_available_itsi', extract_xpath("/hash/resource/publication-year") + to_field 'pdc_created_at_dtsi', extract_xpath('/hash/created-at') to_field "issue_date_strict_ssi" do |record, accumulator, _context| diff --git a/spec/system/search_pdc_results_page_spec.rb b/spec/system/search_pdc_results_page_spec.rb index 5d2b8fae..6ff654ea 100644 --- a/spec/system/search_pdc_results_page_spec.rb +++ b/spec/system/search_pdc_results_page_spec.rb @@ -33,5 +33,9 @@ expect(page).to have_content("System Studies") click_on("System Studies") expect(page).to have_content("Fusion Pilot Plant performance and the role of a Sustained High Power Density tokamak") + + click_on "Year Published" + expect(page).to have_content "View larger" + expect(page).not_to have_content "[Missing]" end end From 9e96047560c40339cf367b4a9c1b07302ec674b7 Mon Sep 17 00:00:00 2001 From: HyppoliteJ Date: Tue, 5 Mar 2024 15:56:09 -0500 Subject: [PATCH 2/2] added test to check for year published facet --- .ruby-version | 2 +- spec/system/search_pdc_results_page_spec.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index 75a22a26..fd2a0186 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0.3 +3.1.0 diff --git a/spec/system/search_pdc_results_page_spec.rb b/spec/system/search_pdc_results_page_spec.rb index 6ff654ea..1a63be63 100644 --- a/spec/system/search_pdc_results_page_spec.rb +++ b/spec/system/search_pdc_results_page_spec.rb @@ -37,5 +37,6 @@ click_on "Year Published" expect(page).to have_content "View larger" expect(page).not_to have_content "[Missing]" + expect(page).to have_content "2022\n2022" end end