Skip to content

Commit b19e034

Browse files
Switch rustdoc-gui test to function call
1 parent 80a9646 commit b19e034

File tree

1 file changed

+29
-17
lines changed

1 file changed

+29
-17
lines changed

src/test/rustdoc-gui/sidebar-mobile.goml

+29-17
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,35 @@ compare-elements-position-near: (".block.keyword li:nth-child(1)", ".mobile-topb
4848

4949
// Now checking the background color of the sidebar.
5050
show-text: true
51-
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "dark"}
52-
reload:
5351

54-
// Open the sidebar menu.
55-
click: ".sidebar-menu-toggle"
56-
assert-css: (".sidebar", {"background-color": "rgb(80, 80, 80)", "color": "rgb(221, 221, 221)"})
57-
58-
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "ayu"}
59-
reload:
60-
61-
// Open the sidebar menu.
62-
click: ".sidebar-menu-toggle"
63-
assert-css: (".sidebar", {"background-color": "rgb(20, 25, 31)", "color": "rgb(197, 197, 197)"})
52+
define-function: (
53+
"check-colors",
54+
(theme, color, background),
55+
[
56+
("local-storage", {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|}),
57+
("reload"),
6458

65-
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "light"}
66-
reload:
59+
// Open the sidebar menu.
60+
("click", ".sidebar-menu-toggle"),
61+
("assert-css", (".sidebar", {
62+
"background-color": |background|,
63+
"color": |color|,
64+
})),
65+
],
66+
)
6767

68-
// Open the sidebar menu.
69-
click: ".sidebar-menu-toggle"
70-
assert-css: (".sidebar", {"background-color": "rgb(245, 245, 245)", "color": "rgb(0, 0, 0)"})
68+
call-function: ("check-colors", {
69+
"theme": "ayu",
70+
"color": "rgb(197, 197, 197)",
71+
"background": "rgb(20, 25, 31)",
72+
})
73+
call-function: ("check-colors", {
74+
"theme": "dark",
75+
"color": "rgb(221, 221, 221)",
76+
"background": "rgb(80, 80, 80)",
77+
})
78+
call-function: ("check-colors", {
79+
"theme": "light",
80+
"color": "rgb(0, 0, 0)",
81+
"background": "rgb(245, 245, 245)",
82+
})

0 commit comments

Comments
 (0)