Add labels to the search form in the management area

The text for the unfeasible checkbox wasn't correctly defined as a
label, while the fields to search investments and select the heading
weren't intuitive since their purpose wasn't obvious.
This commit is contained in:
Javi Martín
2024-10-11 02:09:15 +02:00
parent b45f928703
commit 1cefc040a7
8 changed files with 55 additions and 7 deletions

View File

@@ -0,0 +1,17 @@
require "rails_helper"
describe Management::Budgets::Investments::SearchComponent do
include Rails.application.routes.url_helpers
let(:budget) { create(:budget) }
let(:url) { management_budget_investments_path(budget) }
let(:component) { Management::Budgets::Investments::SearchComponent.new(budget, url: url) }
it "renders a label for each field" do
render_inline component
expect(page).to have_field "Search investments"
expect(page).to have_select "Heading"
expect(page).to have_field "Search unfeasible", type: :checkbox
end
end