|
| 1 | +// This test ensures a few things for item info elements. |
| 2 | +goto: file://|DOC_PATH|/lib2/struct.Foo.html |
| 3 | +// Ensuring that the item information don't take 100% of the width if unnecessary. |
| 4 | +// We set a fixed size so there is no chance of "random" resize. |
| 5 | +size: (1100, 800) |
| 6 | +// We check that ".item-info" is bigger than its content. |
| 7 | +assert-css: (".item-info", {"width": "790px"}) |
| 8 | +assert-css: (".item-info .stab", {"width": "289px"}) |
| 9 | +assert-position: (".item-info .stab", {"x": 295}) |
| 10 | + |
| 11 | +// Now we ensure that they're not rendered on the same line. |
| 12 | +goto: file://|DOC_PATH|/lib2/trait.Trait.html |
| 13 | +// We first ensure that there are two item info on the trait. |
| 14 | +assert-count: ("#main-content > .item-info .stab", 2) |
| 15 | +// They should not have the same `y` position! |
| 16 | +compare-elements-position-false: ( |
| 17 | + "#main-content > .item-info .stab:nth-of-type(1)", |
| 18 | + "#main-content > .item-info .stab:nth-of-type(2)", |
| 19 | + ("y"), |
| 20 | +) |
| 21 | +// But they should have the same `x` position. |
| 22 | +compare-elements-position: ( |
| 23 | + "#main-content > .item-info .stab:nth-of-type(1)", |
| 24 | + "#main-content > .item-info .stab:nth-of-type(2)", |
| 25 | + ("x"), |
| 26 | +) |
| 27 | +// They are supposed to have the same height too. |
| 28 | +compare-elements-css: ( |
| 29 | + "#main-content > .item-info .stab:nth-of-type(1)", |
| 30 | + "#main-content > .item-info .stab:nth-of-type(2)", |
| 31 | + ["height"], |
| 32 | +) |
0 commit comments