Skip to content

Commit

Permalink
chore(innate): add title rule test
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Oct 2, 2023
1 parent 021c4e8 commit cbb3d1b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion kayle_innate/src/engine/rules/wcag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,16 @@ pub struct WCAG3AA {}
impl WCAG3AA {
/// init the rules
pub fn audit(
tree: std::collections::BTreeMap<String, Vec<scraper::node::Element>>,
// allow tree mutation until threads or setup the tree with initial elements.
mut tree: std::collections::BTreeMap<String, Vec<scraper::node::Element>>,
_css: cssparser::Parser<'_, '_>,
) -> Vec<Issue> {

// pre populate must have keys
if !tree.contains_key("title") {
tree.insert("title".into(), Default::default());
}

// go through nodes and map to validation rules
for node in tree {
if RULES_A.contains_key(&*node.0) {
Expand Down

0 comments on commit cbb3d1b

Please sign in to comment.