1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-10 16:05:22 +02:00

Test fixes

This commit is contained in:
Zach Gollwitzer 2025-04-29 17:12:52 -04:00
parent 49501be724
commit a61a752341
11 changed files with 36 additions and 34 deletions

View file

@ -1,6 +1,6 @@
<%= render DialogComponent.new do |dialog| %>
<% dialog.with_header(title: t(".title")) %>
<% dialog.with_body do %>
<%= render "form", family_merchant: @family_merchant %>
<%= render "form", family_merchant: @merchant %>
<% end %>
<% end %>

View file

@ -1,4 +1,6 @@
<%= styled_form_with model: @entry, url: transactions_path, class: "space-y-4 text-subdued", data: { controller: "transaction-form" } do |f| %>
<%# locals: (entry:, income_categories:, expense_categories:) %>
<%= styled_form_with model: entry, url: transactions_path, class: "space-y-4 text-subdued", data: { controller: "transaction-form" } do |f| %>
<% if entry.errors.any? %>
<%= render "shared/form_errors", model: entry %>
<% end %>
@ -21,7 +23,7 @@
<%= f.money_field :amount, label: t(".amount"), required: true %>
<%= f.fields_for :entryable do |ef| %>
<% categories = params[:nature] == "inflow" ? @income_categories : @expense_categories %>
<% categories = params[:nature] == "inflow" ? income_categories : expense_categories %>
<%= ef.collection_select :category_id, categories, :id, :name, { prompt: t(".category_prompt"), label: t(".category") } %>
<% end %>
<%= f.date_field :date, label: t(".date"), required: true, min: Entry.min_supported_date, max: Date.current, value: Date.current %>

View file

@ -1,6 +1,6 @@
<%= render DialogComponent.new do |dialog| %>
<% dialog.with_header(title: "New transaction") %>
<% dialog.with_body do %>
<%= render "form", transaction: @transaction %>
<%= render "form", entry: @entry, income_categories: @income_categories, expense_categories: @expense_categories %>
<% end %>
<% end %>