removing decimal with precision and decimal count

This commit is contained in:
Filipriec
2026-08-24 21:31:06 +02:00
parent 16670f4375
commit 5e9b86c1fb
22 changed files with 50 additions and 467 deletions

View File

@@ -245,20 +245,13 @@ mod tests {
assert!(html.contains("Every profile can use this shared table."));
}
/// Fixed-scale decimal is the one intentionally gated type; enabling the
/// advanced control makes it reachable without removing server support.
/// Every type the server accepts has to be reachable from the picker, or
/// the web UI silently offers less than the backend does.
#[test]
fn the_type_picker_offers_the_parameterised_and_interval_types() {
let mut state = page();
let html = render_builder(&state);
fn the_type_picker_offers_interval_and_accounting_types() {
let html = render_builder(&page());
assert!(!html.contains(r#"<option value="decimal""#));
assert!(html.contains(r#"name="fixed_decimal_input""#));
state.draft.columns.fixed_decimal_input = "yes".to_string();
let html = render_builder(&state);
for column_type in ["decimal", "duration", "period", "accounting"] {
for column_type in ["duration", "period", "accounting"] {
assert!(
html.contains(&format!(r#"<option value="{column_type}""#)),
"the type picker is missing {column_type}"
@@ -279,14 +272,6 @@ mod tests {
state.draft.columns.type_input = "gtin".to_string();
assert!(render_builder(&state).contains(r#"name="gtin_type_input""#));
// Decimal reveals its precision and scale.
state.draft.columns.fixed_decimal_input = "yes".to_string();
state.draft.columns.type_input = "decimal".to_string();
let html = render_builder(&state);
assert!(html.contains(r#"name="decimal_precision_input""#));
assert!(html.contains(r#"name="decimal_scale_input""#));
assert!(html.contains("Advanced fixed-scale decimal"));
// Money reveals its currency and rounding inputs.
state.draft.columns.type_input = "money".to_string();
let html = render_builder(&state);