Skip to main content

fc_dioxus/
testing.rs

1//! SSR and static accessibility helpers for application tests.
2
3use dioxus::prelude::*;
4
5/// Render a component tree deterministically without requiring a browser.
6#[must_use]
7pub fn render_to_html(element: Element) -> String {
8    dioxus_ssr::render_element(element)
9}
10
11/// Audit an HTML fragment using the currently implemented static rules.
12/// This is not a claim of complete WCAG conformance; see the rule catalogue.
13#[must_use]
14pub fn audit(html: &str) -> fc_a11y::Report {
15    fc_a11y::Audit.run(&fc_a11y::Document::parse(html))
16}