web synchronized with the new changes

This commit is contained in:
Priec
2026-08-09 16:30:27 +02:00
parent e66b025188
commit fd551ef7fb
44 changed files with 1215 additions and 88 deletions

View File

@@ -11,6 +11,7 @@ mod pages;
mod schema;
mod services;
mod ui;
mod authz;
mod analytics {
include!(concat!(
env!("CARGO_MANIFEST_DIR"),
@@ -138,6 +139,7 @@ fn router(state: AppState) -> Router {
.merge(pages::login::router())
.merge(pages::register::router())
.merge(pages::admin::admin::router())
.merge(pages::admin::permissions::router())
.merge(pages::admin::table_definition::router())
.merge(pages::add_table::router())
.merge(pages::add_logic::router())
@@ -244,8 +246,17 @@ mod tests {
assert!(!body.contains("hx-post=\"/logout\""));
}
/// The register form carries every `RegisterRequest` field the TUI client
/// asks for, and the suggestion lists for the three the client suggests.
#[tokio::test]
async fn fresh_installation_can_open_the_initial_password_form() {
let (status, body) = get("/initial-password").await;
assert!(status.is_success());
assert!(body.contains("Claim bootstrap administrator"));
assert!(body.contains("value=\"admin\""));
assert!(body.contains("value=\"superadmin\""));
}
/// The register form carries every user-provided `RegisterRequest` field.
/// Role assignment belongs to the administrator permissions page.
#[tokio::test]
async fn the_register_form_offers_the_same_fields_as_the_client() {
let (_, body) = get("/register").await;
@@ -254,7 +265,6 @@ mod tests {
"email",
"password",
"password_confirmation",
"role",
"timezone",
"phone_country",
] {
@@ -263,7 +273,7 @@ mod tests {
"the register form is missing the {field} field"
);
}
assert!(body.contains("value=\"accountant\""));
assert!(!body.contains("name=\"role\""));
assert!(body.contains("value=\"Europe/Bratislava\""));
assert!(body.contains("value=\"SK\""));
}