@@ -4,7 +4,7 @@ store-value: (window_height, 1000)
44
55define-function: (
66 "check-topbar",
7- [width, text_display, search_display, search_max_width ],
7+ [width, text_display, search_display],
88 block {
99 set-window-size: (|width|, |window_height|)
1010 wait-for-css: (".nav-container > .container a > .title", {"display": |text_display|})
@@ -13,12 +13,16 @@ define-function: (
1313 // topbar).
1414 assert-window-property: {"innerWidth": |width|}
1515
16- assert-css: ("#search-input-nav", {"display": |search_display|, "max-width": |search_max_width|})
1716 assert-size: ("body > .nav-container", {"height": |top_navbar_height|})
1817
1918 // And finally we check that the top navbar height didn't change.
2019 store-size: ("body > .nav-container", {"height": tmp_top_navbar_height})
2120 assert: |tmp_top_navbar_height| == |top_navbar_height|
21+
22+ // Checks that there is no x-axis scrollbar.
23+ store-document-property: {"body"."scrollWidth": scroll_width}
24+ // If the scroll width is the same as the viewport width, then all good!
25+ assert-document-property: {"documentElement"."clientWidth": |scroll_width|}
2226 }
2327)
2428
@@ -33,60 +37,51 @@ define-function: (
3337 "width": 1000,
3438 "text_display": "inline",
3539 "search_display": "block",
36- "search_max_width": "200px",
3740 })
3841 call-function: ("check-topbar", {
3942 "width": 900,
4043 "text_display": "inline",
4144 "search_display": "block",
42- "search_max_width": "200px",
4345 })
4446 call-function: ("check-topbar", {
4547 "width": 872,
4648 "text_display": "inline",
4749 "search_display": "block",
48- "search_max_width": "200px",
4950 })
5051 // From this point, text should not be displayed anymore.
5152 call-function: ("check-topbar", {
5253 "width": 871,
5354 "text_display": "none",
5455 "search_display": "block",
55- "search_max_width": "200px",
5656 })
5757 call-function: ("check-topbar", {
5858 "width": 768,
5959 "text_display": "none",
6060 "search_display": "block",
61- "search_max_width": "200px",
6261 })
6362 // From this point, search input should be smaller.
6463 call-function: ("check-topbar", {
6564 "width": 767,
6665 "text_display": "none",
6766 "search_display": "block",
68- "search_max_width": "150px",
6967 })
7068 call-function: ("check-topbar", {
7169 "width": 568,
7270 "text_display": "none",
7371 "search_display": "block",
74- "search_max_width": "150px",
7572 })
7673 // From this point, search input should not be displayed anymore.
7774 call-function: ("check-topbar", {
7875 "width": 567,
7976 "text_display": "none",
8077 "search_display": "none",
81- "search_max_width": "150px",
8278 })
8379 // Even at very small width, we maintain the height of the topbar, but such cases will very likely
8480 // never happen "in real life".
8581 call-function: ("check-topbar", {
8682 "width": 272,
8783 "text_display": "none",
8884 "search_display": "none",
89- "search_max_width": "150px",
9085 })
9186 }
9287)
0 commit comments