11// This test ensures that the settings menu display is working as expected and that
22// the settings page is also rendered as expected.
3+ include: "utils.goml"
34go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
45show-text: true // needed when we check for colors below.
56// First, we check that the settings page doesn't exist.
67assert-false: "#settings"
7- // We now click on the settings button.
8- click: "rustdoc-toolbar .settings-menu"
9- wait-for: "#settings"
8+ call-function: ("open-settings-menu", {})
109assert-css: ("#settings", {"display": "block"})
1110
1211// Store the line margin to compare with the settings.html later.
1312store-css: (".setting-line", {"margin": setting_line_margin})
1413
1514// Let's close it by clicking on the same button.
16- click: "rustdoc-toolbar .settings-menu"
17- wait-for-css: ("#settings", {"display": "none"})
15+ call-function: ("close-settings-menu", {})
1816
1917// Let's check that pressing "ESCAPE" is closing it.
2018click: "rustdoc-toolbar .settings-menu"
@@ -28,8 +26,7 @@ write: "test"
2826// To be SURE that the search will be run.
2927press-key: 'Enter'
3028wait-for: "#alternative-display #search"
31- click: "rustdoc-toolbar .settings-menu"
32- wait-for-css: ("#settings", {"display": "block"})
29+ call-function: ("open-settings-menu", {})
3330// Ensure that the search is still displayed.
3431wait-for: "#alternative-display #search"
3532assert: "#main-content.hidden"
@@ -41,8 +38,7 @@ set-local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"
4138// We reload the page so the local storage settings are being used.
4239reload:
4340
44- click: "rustdoc-toolbar .settings-menu"
45- wait-for: "#settings"
41+ call-function: ("open-settings-menu", {})
4642
4743// We check that the "Use system theme" is disabled.
4844assert-property: ("#theme-system-preference", {"checked": "false"})
0 commit comments