mirror of
https://github.com/we-promise/sure.git
synced 2026-05-12 23:25:00 +00:00
feat(api): expose import row diagnostics (#1644)
* feat(api): expose import row diagnostics * fix(api): stabilize import row diagnostics * fix(api): harden import row diagnostics * fix(api): number Mint import diagnostics rows * fix(api): enforce unique import row diagnostics * fix(api): address import row diagnostics review
This commit is contained in:
@@ -164,6 +164,7 @@ class AccountImportTest < ActiveSupport::TestCase
|
||||
|
||||
test "dry_run returns expected counts" do
|
||||
@import.rows.create!(
|
||||
source_row_number: 1,
|
||||
entity_type: "depository",
|
||||
name: "Test Account",
|
||||
amount: "1000.00",
|
||||
|
||||
19
test/models/mint_import_test.rb
Normal file
19
test/models/mint_import_test.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
require "test_helper"
|
||||
|
||||
class MintImportTest < ActiveSupport::TestCase
|
||||
setup do
|
||||
@family = families(:dylan_family)
|
||||
end
|
||||
|
||||
test "generated rows preserve stable source row numbers" do
|
||||
import = @family.imports.create!(
|
||||
type: "MintImport",
|
||||
raw_file_str: file_fixture("imports/mint.csv").read,
|
||||
col_sep: ","
|
||||
)
|
||||
|
||||
import.generate_rows_from_csv
|
||||
|
||||
assert_equal (1..10).to_a, import.rows.order(:source_row_number).pluck(:source_row_number)
|
||||
end
|
||||
end
|
||||
@@ -131,6 +131,7 @@ class PdfImportTest < ActiveSupport::TestCase
|
||||
|
||||
test "mapping_steps includes CategoryMapping when rows have categories" do
|
||||
@import_with_rows.rows.create!(
|
||||
source_row_number: 1,
|
||||
date: "01/15/2024",
|
||||
amount: -50.00,
|
||||
currency: "USD",
|
||||
|
||||
Reference in New Issue
Block a user