From 76e9d70607bcf0cc1e8233857fdb9972117f3e24 Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Tue, 23 Jan 2024 13:48:14 +0000 Subject: [PATCH] feat: update tests --- spec/components/document_list_component_spec.rb | 3 ++- spec/helpers/collection_resources_helper_spec.rb | 2 +- spec/requests/start_controller_spec.rb | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/spec/components/document_list_component_spec.rb b/spec/components/document_list_component_spec.rb index ee0c32301..1cbde7258 100644 --- a/spec/components/document_list_component_spec.rb +++ b/spec/components/document_list_component_spec.rb @@ -8,8 +8,9 @@ RSpec.describe DocumentListComponent, type: :component do context "when rendering tabs" do it "all of the nav tabs specified in the items hash are passed to it" do - result = render_inline(described_class.new(items:)) + result = render_inline(described_class.new(items:, label: "Label")) + expect(result.text).to include("Label") expect(result.text).to include("PDF Form") expect(result.text).to include("An important form") expect(result.text).to include("4 pages") diff --git a/spec/helpers/collection_resources_helper_spec.rb b/spec/helpers/collection_resources_helper_spec.rb index 90efe3b95..0c87188d7 100644 --- a/spec/helpers/collection_resources_helper_spec.rb +++ b/spec/helpers/collection_resources_helper_spec.rb @@ -7,7 +7,7 @@ RSpec.describe CollectionResourcesHelper do describe "when displaying file metadata" do context "with pages" do it "returns correct metadata" do - expect(file_type_size_and_pages("2023_24_lettings_paper_form.pdf", number_of_pages: 8)).to eq("PDF, 285 KB, 8 pages") + expect(file_type_size_and_pages("2023_24_lettings_paper_form.pdf", number_of_pages: 8)).to eq("PDF, 286 KB, 8 pages") end end diff --git a/spec/requests/start_controller_spec.rb b/spec/requests/start_controller_spec.rb index edca4d7c4..ad1d04b3d 100644 --- a/spec/requests/start_controller_spec.rb +++ b/spec/requests/start_controller_spec.rb @@ -39,8 +39,8 @@ RSpec.describe StartController, type: :request do it "displays correct resources for 2022/23 and 2023/24 collection years" do get "/", headers: headers, params: {} - expect(page).to have_content("Lettings 2023/24") - expect(page).to have_content("Sales 2023/24") + expect(page).to have_content("Lettings 23/24") + expect(page).to have_content("Sales 23/24") end end @@ -51,8 +51,8 @@ RSpec.describe StartController, type: :request do it "displays correct resources for 2022/23 and 2023/24 collection years" do get "/", headers: headers, params: {} - expect(page).not_to have_content("Lettings 2023/24") - expect(page).not_to have_content("Sales 2023/24") + expect(page).not_to have_content("Lettings 23/24") + expect(page).not_to have_content("Sales 23/24") end end