Skip to content

Commit

Permalink
Add regression test for #120471 to ensure that long crate name are ha…
Browse files Browse the repository at this point in the history
…ndled as expected on mobile
  • Loading branch information
GuillaumeGomez committed Jan 31, 2024
1 parent 83bfbbe commit 242add7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/rustdoc-gui/mobile-crate-name.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Checks that if the crate name is too long on mobile, it will be inside a scrollable area
// instead of overflowing the parent.

go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// First we change the title to make it big.
set-window-size: (400, 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")
store-property: (".mobile-topbar .location", {"scrollHeight": scroll, "offsetHeight": height})
assert: |scroll| == |height|
// We change the crate name to something longer.
set-text: (".mobile-topbar .location", "Crate cargo_packager_resource_resolver")
// And we check that it has scroll.
store-property: (".mobile-topbar .location", {"scrollHeight": scroll, "offsetHeight": height})
assert: |scroll| > |height|

0 comments on commit 242add7

Please sign in to comment.