forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add regression test for rust-lang#120471 to ensure that long crate na…
…me are handled as expected on mobile
- Loading branch information
1 parent
9e5247b
commit de6163f
Showing
2 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Checks that if the crate name is too long on mobile, it will not grow and overflow its parent | ||
// (thanks to text overflow ellipsis). | ||
|
||
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" | ||
// First we change the title to make it big. | ||
set-window-size: (350, 800) | ||
// We ensure that the "format" of the title is the same as the one we'll use. | ||
assert-text: (".mobile-topbar .location", "Crate test_docs") | ||
// We store the height we know is correct. | ||
store-property: (".mobile-topbar .location", {"offsetHeight": height}) | ||
// We change the crate name to something longer. | ||
set-text: (".mobile-topbar .location", "Crate cargo_packager_resource_resolver") | ||
// And we check that the size remained the same. | ||
assert-property: (".mobile-topbar .location", {"offsetHeight": |height|}) | ||
|
||
// Now we check if it works for the non-crate pages as well. | ||
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" | ||
// We store the height we know is correct. | ||
store-property: (".mobile-topbar .location", {"offsetHeight": height}) | ||
// We change the crate name to something longer (we need to change the link text here). | ||
set-text: (".mobile-topbar .location a", "Something_incredibly_long_because") | ||
// And we check that the size remained the same. | ||
assert-property: (".mobile-topbar .location", {"offsetHeight": |height|}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters