Skip to content

Commit 242add7

Browse files
Add regression test for #120471 to ensure that long crate name are handled as expected on mobile
1 parent 83bfbbe commit 242add7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Checks that if the crate name is too long on mobile, it will be inside a scrollable area
2+
// instead of overflowing the parent.
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: (400, 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+
store-property: (".mobile-topbar .location", {"scrollHeight": scroll, "offsetHeight": height})
10+
assert: |scroll| == |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 it has scroll.
14+
store-property: (".mobile-topbar .location", {"scrollHeight": scroll, "offsetHeight": height})
15+
assert: |scroll| > |height|

0 commit comments

Comments
 (0)