]>
Commit | Line | Data |
---|---|---|
136023e0 | 1 | // This test checks that the font weight is correctly applied. |
2b03887a FG |
2 | goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html" |
3 | assert-css: ("//*[@class='item-decl']//a[text()='Alias']", {"font-weight": "400"}) | |
a2a8927a XL |
4 | assert-css: ( |
5 | "//*[@class='structfield small-section-header']//a[text()='Alias']", | |
6 | {"font-weight": "400"}, | |
7 | ) | |
136023e0 XL |
8 | assert-css: ("#method\.a_method > .code-header", {"font-weight": "600"}) |
9 | assert-css: ("#associatedtype\.X > .code-header", {"font-weight": "600"}) | |
10 | assert-css: ("#associatedconstant\.Y > .code-header", {"font-weight": "600"}) | |
11 | ||
2b03887a | 12 | goto: "file://" + |DOC_PATH| + "/test_docs/type.SomeType.html" |
136023e0 XL |
13 | assert-css: (".top-doc .docblock p", {"font-weight": "400"}, ALL) |
14 | ||
2b03887a FG |
15 | goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" |
16 | assert-css: (".impl-items .method > .code-header", {"font-weight": "600"}, ALL) | |
136023e0 | 17 | |
2b03887a | 18 | goto: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html" |
94222f64 XL |
19 | |
20 | // This is a complex selector, so here's how it works: | |
21 | // | |
2b03887a | 22 | // * //*[@class='item-decl'] — selects element of any tag with classes docblock and item-decl |
94222f64 XL |
23 | // * /pre[@class='rust trait'] — selects immediate child with tag pre and classes rust and trait |
24 | // * /code — selects immediate child with tag code | |
25 | // * /a[@class='constant'] — selects immediate child with tag a and class constant | |
26 | // * //text() — selects child that is text node | |
27 | // * /parent::* — selects immediate parent of the text node (the * means it can be any tag) | |
28 | // | |
29 | // This uses '/parent::*' as a proxy for the style of the text node. | |
30 | // We can't just select the '<a>' because intermediate tags could be added. | |
a2a8927a | 31 | assert-count: ( |
2b03887a | 32 | "//*[@class='item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*", |
a2a8927a XL |
33 | 1, |
34 | ) | |
35 | assert-css: ( | |
2b03887a | 36 | "//*[@class='item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*", |
a2a8927a XL |
37 | {"font-weight": "400"}, |
38 | ) | |
94222f64 | 39 | |
a2a8927a XL |
40 | assert-count: (".methods .associatedtype", 1) |
41 | assert-css: (".methods .associatedtype", {"font-weight": "600"}) | |
136023e0 XL |
42 | assert-count: (".methods .constant", 1) |
43 | assert-css: (".methods .constant", {"font-weight": "600"}) | |
2b03887a | 44 | assert-css: (".methods .method > .code-header", {"font-weight": "600"}) |