Skip to content

Commit b728426

Browse files
GuillaumeGomezJoshua Nelson
authored and
Joshua Nelson
committed
Add test to check that tabindex is still on nav-search to avoid regression
1 parent 65421ed commit b728426

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/web/mod.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,4 +927,20 @@ mod test {
927927

928928
assert_eq!(correct_json, serde_json::to_value(&metadata).unwrap());
929929
}
930+
931+
#[test]
932+
fn test_tabindex_is_present_on_topbar_crate_search_input() {
933+
wrapper(|env| {
934+
release("0.1.0", env);
935+
let web = env.frontend();
936+
let text = web.get("/foo/0.1.0/foo").send()?.text()?;
937+
let tabindex = kuchiki::parse_html()
938+
.one(text)
939+
.select(r#"#nav-search[tabindex="-1"]"#)
940+
.unwrap()
941+
.count();
942+
assert_eq!(tabindex, 1);
943+
Ok(())
944+
});
945+
}
930946
}

0 commit comments

Comments
 (0)