//! Empty `#modal-slot` container.

/// Render the modal slot.
pub fn render_modal_slot() -> String {
    rustelo_pages_htmx::fragment_env()
        .and_then(|env| {
            env.get_template("partials/overlays/modal_slot.j2")
                .and_then(|t| t.render(minijinja::Value::UNDEFINED))
                .ok()
        })
        .unwrap_or_else(|| String::from(r#"<div id="modal-slot" aria-live="polite"></div>"#))
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn slot_has_stable_id() {
        assert!(render_modal_slot().contains(r#"id="modal-slot""#));
    }
}
