web synchronized with the new changes
This commit is contained in:
@@ -99,7 +99,7 @@ mod tests {
|
||||
use crate::{
|
||||
pages::admin::table_definition::state::{
|
||||
CopyForm, DetailColumn, InvoiceTemplateForm, RenameForm, Selection, TableDetailView,
|
||||
TableSummary,
|
||||
TablePermissionAction, TableRolePermissions, TableSummary,
|
||||
},
|
||||
schema::ColumnDraft,
|
||||
};
|
||||
@@ -149,6 +149,8 @@ mod tests {
|
||||
error: None,
|
||||
sql: None,
|
||||
generated: Vec::new(),
|
||||
permission_object: String::new(),
|
||||
role_permissions: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,6 +298,26 @@ mod tests {
|
||||
assert!(html.contains("1 column added"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn selected_table_exposes_its_data_permission_actions() {
|
||||
let mut page = page();
|
||||
page.permission_object = "data:billing/invoice".to_string();
|
||||
page.role_permissions = vec![TableRolePermissions {
|
||||
role: "bookkeeper".to_string(),
|
||||
actions: vec![TablePermissionAction {
|
||||
action: "read".to_string(),
|
||||
direct: false,
|
||||
effective: false,
|
||||
}],
|
||||
}];
|
||||
|
||||
let html = render_workspace(&page);
|
||||
assert!(!html.contains("Template error"), "{html}");
|
||||
assert!(html.contains("Data permissions for"));
|
||||
assert!(html.contains("data:billing/invoice"));
|
||||
assert!(html.contains("Grant read"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_load_failure_answers_with_the_dialog() {
|
||||
let html = render_load_error("The backend is unreachable.");
|
||||
|
||||
Reference in New Issue
Block a user