1
Fork 0

Add test to ensure font-weight is applied correctly

This commit is contained in:
Guillaume Gomez 2021-06-13 21:50:11 +02:00
parent d87ec7ae19
commit 466aec9957
3 changed files with 31 additions and 1 deletions

View file

@ -0,0 +1,7 @@
goto: file://|DOC_PATH|/lib2/struct.Foo.html
// This test checks that the font weight is correctly applied.
assert: ("//*[@class='docblock type-decl']//a[text()='Alias']", {"font-weight": "400"})
assert: ("//*[@class='structfield small-section-header']//a[text()='Alias']", {"font-weight": "400"})
assert: ("#method\.a_method > code", {"font-weight": "600"})
assert: ("#associatedtype\.X > code", {"font-weight": "600"})
assert: ("#associatedconstant\.Y > code", {"font-weight": "600"})

View file

@ -31,7 +31,10 @@ assert: (".sidebar > .location", "Crate lib2")
assert: (".sidebar-elems > .crate > ul > li > a.current", "lib2") assert: (".sidebar-elems > .crate > ul > li > a.current", "lib2")
// We now go to the "foobar" function page. // We now go to the "foobar" function page.
assert: (".sidebar-elems > .items > ul > li:nth-child(1)", "Modules") assert: (".sidebar-elems > .items > ul > li:nth-child(1)", "Modules")
assert: (".sidebar-elems > .items > ul > li:nth-child(2)", "Functions") assert: (".sidebar-elems > .items > ul > li:nth-child(2)", "Structs")
assert: (".sidebar-elems > .items > ul > li:nth-child(3)", "Traits")
assert: (".sidebar-elems > .items > ul > li:nth-child(4)", "Functions")
assert: (".sidebar-elems > .items > ul > li:nth-child(5)", "Type Definitions")
assert: ("#functions + table td > a", "foobar") assert: ("#functions + table td > a", "foobar")
click: "#functions + table td > a" click: "#functions + table td > a"

View file

@ -9,3 +9,23 @@ pub mod module {
} }
pub fn foobar() {} pub fn foobar() {}
pub type Alias = u32;
pub struct Foo {
pub x: Alias,
}
impl Foo {
pub fn a_method(&self) {}
}
pub trait Trait {
type X;
const Y: u32;
}
impl Trait for Foo {
type X = u32;
const Y: u32 = 0;
}