aliasing for accounting, where accounting real column names are the same as others, which is 0..n as opposed to previously real names and hardcoded search via those. Now we are using a look up table for the numbers mapping to look em up

This commit is contained in:
Priec
2026-08-13 13:41:07 +02:00
parent 774c9a3ce0
commit 27d3e9af34
11 changed files with 444 additions and 10 deletions

View File

@@ -125,6 +125,34 @@ mod tests {
assert!(html.contains("TIMESTAMPTZ"));
}
/// The columns an ACCOUNTING row generates get a name field of their own,
/// which is what makes them aliasable at creation time.
#[test]
fn generated_accounting_columns_get_an_alias_field() {
let mut page = page();
page.draft.columns.added.push(ColumnDefinition {
name: "accounting".to_string(),
data_type: "accounting".to_string(),
indexed: false,
quantity_ledger: false,
money_mode: MoneyMode::Exact,
currency: "EUR".to_string(),
});
let html = render_builder(&page);
assert!(!html.contains("Template error"), "{html}");
for generated in ["name", "tax_point_date", "debit", "credit", "account"] {
assert!(
html.contains(&format!(
r#"<input type="hidden" name="generated_alias_sources" value="{generated}">"#
)),
"`{generated}` should be aliasable"
);
}
assert!(html.contains(r#"name="generated_alias_names""#));
}
#[test]
fn the_page_offers_the_new_profile_option_and_the_currency_list() {
let html = render_page(&page());