|
| 1 | +// Checks that if the crate name is too long on mobile, it will not grow and overflow its parent |
| 2 | +// (thanks to text overflow ellipsis). |
| 3 | + |
| 4 | +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" |
| 5 | +// First we change the title to make it big. |
| 6 | +set-window-size: (350, 800) |
| 7 | +// We ensure that the "format" of the title is the same as the one we'll use. |
| 8 | +assert-text: (".mobile-topbar .location", "Crate test_docs") |
| 9 | +// We store the height we know is correct. |
| 10 | +store-property: (".mobile-topbar .location", {"offsetHeight": height}) |
| 11 | +// We change the crate name to something longer. |
| 12 | +set-text: (".mobile-topbar .location", "Crate cargo_packager_resource_resolver") |
| 13 | +// And we check that the size remained the same. |
| 14 | +assert-property: (".mobile-topbar .location", {"offsetHeight": |height|}) |
| 15 | + |
| 16 | +// Now we check if it works for the non-crate pages as well. |
| 17 | +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" |
| 18 | +// We store the height we know is correct. |
| 19 | +store-property: (".mobile-topbar .location", {"offsetHeight": height}) |
| 20 | +// We change the crate name to something longer (we need to change the link text here). |
| 21 | +set-text: (".mobile-topbar .location a", "Something_incredibly_long_because") |
| 22 | +// And we check that the size remained the same. |
| 23 | +assert-property: (".mobile-topbar .location", {"offsetHeight": |height|}) |
0 commit comments