organization of incoming data

This commit is contained in:
Priec
2026-08-12 17:46:58 +02:00
parent 08af99e334
commit 719bae0cd2
10 changed files with 184 additions and 24 deletions

View File

@@ -63,7 +63,7 @@ pub(crate) fn render_submission_error(message: &str) -> String {
mod tests {
use super::*;
use crate::{
pages::add_table::draft::TableDraft,
pages::add_table::draft::{RelationTableOption, TableDraft},
schema::{ColumnDefinition, MoneyMode},
};
@@ -80,7 +80,23 @@ mod tests {
money_mode: MoneyMode::Exact,
currency: String::new(),
});
draft.set_available_relation_tables(vec!["customer".to_string()]);
draft.set_available_relation_table_options(vec![
RelationTableOption {
name: "customer".to_string(),
global: false,
system: false,
},
RelationTableOption {
name: "currencies".to_string(),
global: true,
system: false,
},
RelationTableOption {
name: "audit_log".to_string(),
global: false,
system: true,
},
]);
draft.toggle_row_display_candidate(1);
AddTablePageState {
@@ -172,9 +188,13 @@ mod tests {
state.draft.columns.type_input = "link".to_string();
let html = render_builder(&state);
assert!(html.contains(r#">FKlink</option>"#));
assert!(html.contains("Link alias"));
assert!(html.contains(r#"name="link_table_input""#));
assert!(html.contains(r#"<option value="customer""#));
assert!(html.contains(r#"<optgroup label="Global">"#));
assert!(html.contains(r#"<optgroup label="User-created">"#));
assert!(html.contains(r#"<optgroup label="System-created">"#));
}
#[test]