@@ -4,21 +4,25 @@ store-value: (window_height, 1000)
4
4
5
5
define-function: (
6
6
"check-topbar",
7
- [width, text_display, search_display, search_max_width ],
7
+ [width, text_display, search_display],
8
8
block {
9
9
set-window-size: (|width|, |window_height|)
10
10
wait-for-css: (".nav-container > .container a > .title", {"display": |text_display|})
11
11
12
12
// We check that there is no horizontal scrollbar (which would be because of docs.rs
13
13
// topbar).
14
14
assert-window-property: {"innerWidth": |width|}
15
+ wait-for-document-property: {"documentElement"."clientWidth": |width|}
15
16
16
- assert-css: ("#search-input-nav", {"display": |search_display|, "max-width": |search_max_width|})
17
17
assert-size: ("body > .nav-container", {"height": |top_navbar_height|})
18
18
19
19
// And finally we check that the top navbar height didn't change.
20
20
store-size: ("body > .nav-container", {"height": tmp_top_navbar_height})
21
21
assert: |tmp_top_navbar_height| == |top_navbar_height|
22
+
23
+ // Checks that there is no x-axis scrollbar.
24
+ // If the scroll width is the same as the viewport width, then all good!
25
+ assert-document-property: {"body"."scrollWidth": |width|}
22
26
}
23
27
)
24
28
@@ -33,60 +37,51 @@ define-function: (
33
37
"width": 1000,
34
38
"text_display": "inline",
35
39
"search_display": "block",
36
- "search_max_width": "200px",
37
40
})
38
41
call-function: ("check-topbar", {
39
42
"width": 900,
40
43
"text_display": "inline",
41
44
"search_display": "block",
42
- "search_max_width": "200px",
43
45
})
44
46
call-function: ("check-topbar", {
45
47
"width": 872,
46
48
"text_display": "inline",
47
49
"search_display": "block",
48
- "search_max_width": "200px",
49
50
})
50
51
// From this point, text should not be displayed anymore.
51
52
call-function: ("check-topbar", {
52
53
"width": 871,
53
54
"text_display": "none",
54
55
"search_display": "block",
55
- "search_max_width": "200px",
56
56
})
57
57
call-function: ("check-topbar", {
58
58
"width": 768,
59
59
"text_display": "none",
60
60
"search_display": "block",
61
- "search_max_width": "200px",
62
61
})
63
62
// From this point, search input should be smaller.
64
63
call-function: ("check-topbar", {
65
64
"width": 767,
66
65
"text_display": "none",
67
66
"search_display": "block",
68
- "search_max_width": "150px",
69
67
})
70
68
call-function: ("check-topbar", {
71
69
"width": 568,
72
70
"text_display": "none",
73
71
"search_display": "block",
74
- "search_max_width": "150px",
75
72
})
76
73
// From this point, search input should not be displayed anymore.
77
74
call-function: ("check-topbar", {
78
75
"width": 567,
79
76
"text_display": "none",
80
77
"search_display": "none",
81
- "search_max_width": "150px",
82
78
})
83
79
// Even at very small width, we maintain the height of the topbar, but such cases will very likely
84
80
// never happen "in real life".
85
81
call-function: ("check-topbar", {
86
- "width": 272 ,
82
+ "width": 310 ,
87
83
"text_display": "none",
88
84
"search_display": "none",
89
- "search_max_width": "150px",
90
85
})
91
86
}
92
87
)
0 commit comments