fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.9 KiB139 linesraw
1// This test ensures that the elements in ".search-form" have the expected display.
2go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
3show-text: true
4
5define-function: (
6    "check-search-colors",
7    (
8        theme, border, background, search_input_color, search_input_border_focus,
9        menu_button_border, menu_button_a_color, menu_button_a_border_hover, menu_a_color,
10    ),
11    block {
12        set-local-storage: {
13            "rustdoc-theme": |theme|,
14            "rustdoc-use-system-theme": "false",
15        }
16        reload:
17        assert-css: (
18            ".search-input",
19            {
20                "border-color": |border|,
21                "background-color": |background|,
22                "color": |search_input_color|,
23            },
24        )
25        // Focus on search input.
26        focus: ".search-input"
27        assert-css: (
28            ".search-input",
29            {
30                "border-color": |search_input_border_focus|,
31                "background-color": |background|,
32                "color": |search_input_color|,
33            },
34        )
35        assert-css: (
36            "#help-button",
37            {"border-color": |menu_button_border|},
38        )
39        assert-css: (
40            "#help-button > a",
41            {
42                "color": |menu_button_a_color|,
43                "border-color": |border|,
44                "background-color": |background|,
45            },
46        )
47        // Hover help button.
48        move-cursor-to: "#help-button"
49        assert-css: (
50            "#help-button:hover",
51            {"border-color": |menu_button_border|},
52        )
53        assert-css: (
54            "#help-button > a",
55            {
56                "color": |menu_button_a_color|,
57                "border-color": |menu_button_a_border_hover|,
58                "background-color": |background|,
59            },
60        )
61        // Link color inside
62        click: "#help-button"
63        assert-css: (
64            "#help a",
65            {
66                "color": |menu_a_color|,
67            },
68        )
69        assert-css: (
70            "#settings-menu",
71            {"border-color": |menu_button_border|},
72        )
73        assert-css: (
74            "#settings-menu > a",
75            {
76                "color": |menu_button_a_color|,
77                "border-color": |border|,
78                "background-color": |background|,
79            },
80        )
81        // Hover settings menu.
82        move-cursor-to: "#settings-menu"
83        assert-css: (
84            "#settings-menu:hover",
85            {"border-color": |menu_button_border|},
86        )
87        assert-css: (
88            "#settings-menu:hover > a",
89            {
90                "color": |menu_button_a_color|,
91                "border-color": |menu_button_a_border_hover|,
92                "background-color": |background|,
93            },
94        )
95    },
96)
97
98call-function: (
99    "check-search-colors",
100    {
101        "theme": "ayu",
102        "border": "#5c6773",
103        "background": "#141920",
104        "search_input_color": "#fff",
105        "search_input_border_focus": "#5c6773",
106        "menu_button_border": "#c5c5c5",
107        "menu_button_a_color": "#fff",
108        "menu_button_a_border_hover": "#e0e0e0",
109        "menu_a_color": "#39afd7",
110    }
111)
112call-function: (
113    "check-search-colors",
114    {
115        "theme": "dark",
116        "border": "#e0e0e0",
117        "background": "#f0f0f0",
118        "search_input_color": "#111",
119        "search_input_border_focus": "#008dfd",
120        "menu_button_border": "#ddd",
121        "menu_button_a_color": "#000",
122        "menu_button_a_border_hover": "#ffb900",
123        "menu_a_color": "#d2991d",
124    }
125)
126call-function: (
127    "check-search-colors",
128    {
129        "theme": "light",
130        "border": "#e0e0e0",
131        "background": "#fff",
132        "search_input_color": "#000",
133        "search_input_border_focus": "#66afe9",
134        "menu_button_border": "#000",
135        "menu_button_a_color": "#000",
136        "menu_button_a_border_hover": "#717171",
137        "menu_a_color": "#3873ad",
138    }
139)