Browse Source

Merge branch 'main' into CLDC-4141-use-prefers-not-to-say-text

pull/3176/head
Nat Dean-Lewis 6 days ago
parent
commit
c22fe17949
  1. 2
      config/locales/forms/2026/lettings/household_situation.en.yml
  2. 30
      spec/features/bulk_upload_sales_logs_spec.rb

2
config/locales/forms/2026/lettings/household_situation.en.yml

@ -35,7 +35,7 @@ en:
reason: reason:
check_answer_label: "Reason for leaving last settled home" check_answer_label: "Reason for leaving last settled home"
check_answer_prompt: "" check_answer_prompt: ""
hint_text: "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living previously." hint_text: "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living immediately before that period."
question_text: "What is the tenant’s main reason for the household leaving their last settled home?" question_text: "What is the tenant’s main reason for the household leaving their last settled home?"
reasonother: reasonother:
check_answer_label: "" check_answer_label: ""

30
spec/features/bulk_upload_sales_logs_spec.rb

@ -1,7 +1,10 @@
require "rails_helper" require "rails_helper"
RSpec.describe "Bulk upload sales log" do RSpec.describe "Bulk upload sales log" do
include CollectionTimeHelper
let(:user) { create(:user) } let(:user) { create(:user) }
let(:crossover_period) { nil }
let(:stub_file_upload) do let(:stub_file_upload) do
vcap_services = { "aws-s3-bucket" => {} } vcap_services = { "aws-s3-bucket" => {} }
@ -17,17 +20,12 @@ RSpec.describe "Bulk upload sales log" do
before do before do
stub_file_upload stub_file_upload
sign_in user sign_in user
allow(FormHandler.instance).to receive(:sales_in_crossover_period?).and_return(crossover_period)
end end
# rubocop:disable RSpec/AnyInstance # rubocop:disable RSpec/AnyInstance
context "when during crossover period" do context "when during crossover period" do
before do let(:crossover_period) { true }
Timecop.freeze(2024, 5, 1)
end
after do
Timecop.return
end
it "shows journey with year option" do it "shows journey with year option" do
visit("/sales-logs") visit("/sales-logs")
@ -38,15 +36,15 @@ RSpec.describe "Bulk upload sales log" do
click_button("Continue") click_button("Continue")
expect(page).to have_content("You must select a collection period to upload for") expect(page).to have_content("You must select a collection period to upload for")
choose("2024 to 2025") choose("#{current_collection_start_year} to #{current_collection_end_year}")
click_button("Continue") click_button("Continue")
click_link("Back") click_link("Back")
expect(page.find_field("form-year-2024-field")).to be_checked expect(page.find_field("form-year-#{current_collection_start_year}-field")).to be_checked
click_button("Continue") click_button("Continue")
expect(page).to have_content("Upload sales logs in bulk (2024 to 2025)") expect(page).to have_content("Upload sales logs in bulk (#{current_collection_start_year} to #{current_collection_end_year})")
click_button("Continue") click_button("Continue")
expect(page).to have_content("Upload your file") expect(page).to have_content("Upload your file")
@ -80,7 +78,7 @@ RSpec.describe "Bulk upload sales log" do
expect(page).to have_content("Which year") expect(page).to have_content("Which year")
click_button("Continue") click_button("Continue")
click_button("Continue") click_button("Continue")
choose("2024 to 2025") choose("#{current_collection_start_year} to #{current_collection_end_year}")
click_button("Continue") click_button("Continue")
click_button("Continue") click_button("Continue")
@ -95,20 +93,14 @@ RSpec.describe "Bulk upload sales log" do
# rubocop:enable RSpec/AnyInstance # rubocop:enable RSpec/AnyInstance
context "when not in crossover period" do context "when not in crossover period" do
before do let(:crossover_period) { false }
Timecop.freeze(2025, 2, 1)
end
after do
Timecop.return
end
it "shows journey without year option" do it "shows journey without year option" do
visit("/sales-logs") visit("/sales-logs")
expect(page).to have_link("Upload sales logs in bulk") expect(page).to have_link("Upload sales logs in bulk")
click_link("Upload sales logs in bulk") click_link("Upload sales logs in bulk")
expect(page).to have_content("Upload sales logs in bulk (2024 to 2025)") expect(page).to have_content("Upload sales logs in bulk (#{current_collection_start_year} to #{current_collection_end_year})")
click_button("Continue") click_button("Continue")
expect(page).to have_content("Upload your file") expect(page).to have_content("Upload your file")

Loading…
Cancel
Save