diff --git a/src/commands/mod.rs b/src/commands/mod.rs
index 1f54a45..7699900 100644
--- a/src/commands/mod.rs
+++ b/src/commands/mod.rs
@@ -14,7 +14,7 @@ use crate::config::{
#[derive(Debug, Parser)]
pub struct GenConfigArgs {}
-fn generate_frontend_secret() -> [u8; 64] {
+pub fn generate_frontend_secret() -> [u8; 64] {
let mut rng = rand::thread_rng();
let mut secret = [0u8; 64];
diff --git a/src/main.rs b/src/main.rs
index b6adb56..1c0dcd1 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -115,3 +115,67 @@ async fn main() -> Result<()> {
}
Ok(())
}
+
+#[cfg(test)]
+mod tests {
+ use crate::{app::make_app, commands::generate_frontend_secret, get_data_stores};
+ use actix_web::{http::StatusCode, test::TestRequest};
+ use async_trait::async_trait;
+ use rustical_frontend::FrontendConfig;
+ use rustical_store::auth::{AuthenticationProvider, UserStore};
+ use std::sync::Arc;
+
+ #[derive(Debug, Clone)]
+ struct MockUserStore;
+
+ #[async_trait]
+ impl UserStore for MockUserStore {
+ async fn get_user(
+ &self,
+ id: &str,
+ ) -> Result