aliasing now move column position also
This commit is contained in:
@@ -211,7 +211,7 @@ mod tests {
|
||||
use super::*;
|
||||
use crate::{
|
||||
pages::admin::table_definition::state::{
|
||||
CopyForm, DetailColumn, InvoiceTemplateForm, RenameForm, Selection, TableDetailView,
|
||||
CopyForm, DetailColumn, InvoiceTemplateForm, Selection, TableDetailView,
|
||||
TableSummary,
|
||||
},
|
||||
schema::ColumnDraft,
|
||||
@@ -240,6 +240,7 @@ mod tests {
|
||||
row_display_columns: vec!["number".to_string()],
|
||||
scripts: Vec::new(),
|
||||
columns: vec![DetailColumn {
|
||||
column_id: 1,
|
||||
name: "number".to_string(),
|
||||
field_type: "text".to_string(),
|
||||
sql_type: "TEXT".to_string(),
|
||||
@@ -254,7 +255,6 @@ mod tests {
|
||||
}),
|
||||
history: Vec::new(),
|
||||
columns: ColumnDraft::for_append(crate::schema::tests::catalog()),
|
||||
rename: RenameForm::default(),
|
||||
copy: CopyForm::default(),
|
||||
invoice: InvoiceTemplateForm::default(),
|
||||
status: None,
|
||||
@@ -307,7 +307,7 @@ mod tests {
|
||||
assert!(html.contains("/admin/tables/delete"));
|
||||
assert!(html.contains("Type <code>invoice</code> to confirm"));
|
||||
// The other writes are links in the switcher, not forms on the page.
|
||||
assert!(!html.contains("/admin/tables/rename"));
|
||||
assert!(!html.contains("/admin/tables/presentation"));
|
||||
assert!(!html.contains("/admin/profiles/copy?profile=billing\" method"));
|
||||
}
|
||||
|
||||
@@ -368,7 +368,17 @@ mod tests {
|
||||
assert!(!html.contains(r#"name="confirm_table_name""#));
|
||||
|
||||
let html = render_columns_page(&state);
|
||||
assert!(!html.contains("/admin/tables/rename"));
|
||||
assert!(!html.contains("/admin/tables/presentation"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn column_presentation_posts_stable_ids_aliases_and_order_controls() {
|
||||
let html = render_columns_page(&page());
|
||||
|
||||
assert!(html.contains(r#"hx-post="/admin/tables/presentation""#), "{html}");
|
||||
assert!(html.contains(r#"name="column_ids" value="1""#), "{html}");
|
||||
assert!(html.contains(r#"name="aliases" value="number""#), "{html}");
|
||||
assert!(html.contains(r#"name="action" value="save""#), "{html}");
|
||||
}
|
||||
|
||||
/// The profile-wide pages need only a profile, and say so by still
|
||||
|
||||
Reference in New Issue
Block a user