Browse Source

feat: update tests

pull/2216/head
natdeanlewissoftwire 2 years ago
parent
commit
51d7ef2937
  1. 8
      spec/features/organisation_spec.rb
  2. 3
      spec/helpers/filters_helper_spec.rb

8
spec/features/organisation_spec.rb

@ -196,9 +196,9 @@ RSpec.describe "User Features" do
end
it "can filter lettings logs by year" do
check("years-2021-field")
check("years-2022-field")
click_button("Apply filters")
expect(page).to have_current_path("/organisations/#{org_id}/lettings-logs?years[]=&years[]=2021&status[]=&needstypes[]=&assigned_to=all&user=&owning_organisation_select=all&owning_organisation=&managing_organisation_select=all&managing_organisation=")
expect(page).to have_current_path("/organisations/#{org_id}/lettings-logs?years[]=&years[]=2022&status[]=&needstypes[]=&assigned_to=all&user=&owning_organisation_select=all&owning_organisation=&managing_organisation_select=all&managing_organisation=")
expect(page).not_to have_link first_log.id.to_s, href: "/lettings-logs/#{first_log.id}"
end
@ -241,9 +241,9 @@ RSpec.describe "User Features" do
organisation.sales_logs.map(&:id).each do |sales_log_id|
expect(page).to have_link sales_log_id.to_s, href: "/sales-logs/#{sales_log_id}"
end
check("years-2021-field")
check("years-2022-field")
click_button("Apply filters")
expect(page).to have_current_path("/organisations/#{org_id}/sales-logs?years[]=&years[]=2021&status[]=&assigned_to=all&user=&owning_organisation_select=all&owning_organisation=&managing_organisation_select=all&managing_organisation=")
expect(page).to have_current_path("/organisations/#{org_id}/sales-logs?years[]=&years[]=2022&status[]=&assigned_to=all&user=&owning_organisation_select=all&owning_organisation=&managing_organisation_select=all&managing_organisation=")
expect(page).not_to have_link first_log.id.to_s, href: "/sales-logs/#{first_log.id}"
end
end

3
spec/helpers/filters_helper_spec.rb

@ -251,7 +251,8 @@ RSpec.describe FiltersHelper do
it "has the correct options" do
expect(collection_year_options).to eq(
{
"2023" => "2023/24", "2022" => "2022/23", "2021" => "2021/22"
# "2023" => "2023/24", "2022" => "2022/23", "2021" => "2021/22" revert to this after PO
"2024" => "2024/25", "2023" => "2023/24", "2022" => "2022/23"
},
)
end

Loading…
Cancel
Save