|
| 1 | +// This test ensures that the elements in ".search-form" have the expected display. |
| 2 | +goto: file://|DOC_PATH|/test_docs/index.html |
| 3 | +show-text: true |
| 4 | + |
| 5 | +// Ayu theme |
| 6 | +local-storage: { |
| 7 | + "rustdoc-theme": "ayu", |
| 8 | + "rustdoc-use-system-theme": "false", |
| 9 | +} |
| 10 | +reload: |
| 11 | + |
| 12 | +assert-css: ( |
| 13 | + ".search-input", |
| 14 | + { |
| 15 | + "border-color": "rgb(92, 103, 115)", |
| 16 | + "background-color": "rgb(20, 25, 32)", |
| 17 | + "color": "rgb(255, 255, 255)", |
| 18 | + }, |
| 19 | +) |
| 20 | +focus: ".search-input" |
| 21 | +// Nothing should change. |
| 22 | +assert-css: ( |
| 23 | + ".search-input", |
| 24 | + { |
| 25 | + "border-color": "rgb(92, 103, 115)", |
| 26 | + "background-color": "rgb(20, 25, 32)", |
| 27 | + "color": "rgb(255, 255, 255)", |
| 28 | + }, |
| 29 | +) |
| 30 | + |
| 31 | +assert-css: ( |
| 32 | + "#help-button", |
| 33 | + {"border-color": "rgb(197, 197, 197)"}, |
| 34 | +) |
| 35 | +assert-css: ( |
| 36 | + "#help-button > button", |
| 37 | + { |
| 38 | + "color": "rgb(255, 255, 255)", |
| 39 | + "border-color": "rgb(92, 103, 115)", |
| 40 | + "background-color": "rgb(20, 25, 32)", |
| 41 | + }, |
| 42 | +) |
| 43 | +move-cursor-to: "#help-button" |
| 44 | +assert-css: ( |
| 45 | + "#help-button:hover", |
| 46 | + {"border-color": "rgb(197, 197, 197)"}, |
| 47 | +) |
| 48 | +// Only "border-color" should change. |
| 49 | +assert-css: ( |
| 50 | + "#help-button:hover > button", |
| 51 | + { |
| 52 | + "color": "rgb(255, 255, 255)", |
| 53 | + "border-color": "rgb(224, 224, 224)", |
| 54 | + "background-color": "rgb(20, 25, 32)", |
| 55 | + }, |
| 56 | +) |
| 57 | + |
| 58 | +assert-css: ( |
| 59 | + "#settings-menu", |
| 60 | + {"border-color": "rgb(197, 197, 197)"}, |
| 61 | +) |
| 62 | +assert-css: ( |
| 63 | + "#settings-menu > a", |
| 64 | + { |
| 65 | + "color": "rgb(255, 255, 255)", |
| 66 | + "border-color": "rgb(92, 103, 115)", |
| 67 | + "background-color": "rgb(20, 25, 32)", |
| 68 | + }, |
| 69 | +) |
| 70 | +move-cursor-to: "#settings-menu" |
| 71 | +assert-css: ( |
| 72 | + "#settings-menu:hover", |
| 73 | + {"border-color": "rgb(197, 197, 197)"}, |
| 74 | +) |
| 75 | +// Only "border-color" should change. |
| 76 | +assert-css: ( |
| 77 | + "#settings-menu:hover > a", |
| 78 | + { |
| 79 | + "color": "rgb(255, 255, 255)", |
| 80 | + "border-color": "rgb(224, 224, 224)", |
| 81 | + "background-color": "rgb(20, 25, 32)", |
| 82 | + }, |
| 83 | +) |
| 84 | + |
| 85 | +// Dark theme |
| 86 | +local-storage: { |
| 87 | + "rustdoc-theme": "dark", |
| 88 | + "rustdoc-use-system-theme": "false", |
| 89 | +} |
| 90 | +reload: |
| 91 | + |
| 92 | +assert-css: ( |
| 93 | + ".search-input", |
| 94 | + { |
| 95 | + "border-color": "rgb(240, 240, 240)", |
| 96 | + "background-color": "rgb(240, 240, 240)", |
| 97 | + "color": "rgb(17, 17, 17)", |
| 98 | + }, |
| 99 | +) |
| 100 | +focus: ".search-input" |
| 101 | +// Only "border-color" should change. |
| 102 | +assert-css: ( |
| 103 | + ".search-input", |
| 104 | + { |
| 105 | + "border-color": "rgb(0, 141, 253)", |
| 106 | + "background-color": "rgb(240, 240, 240)", |
| 107 | + "color": "rgb(17, 17, 17)", |
| 108 | + }, |
| 109 | +) |
| 110 | + |
| 111 | +assert-css: ( |
| 112 | + "#help-button", |
| 113 | + {"border-color": "rgb(221, 221, 221)"}, |
| 114 | +) |
| 115 | +assert-css: ( |
| 116 | + "#help-button > button", |
| 117 | + { |
| 118 | + "color": "rgb(0, 0, 0)", |
| 119 | + "border-color": "rgb(224, 224, 224)", |
| 120 | + "background-color": "rgb(240, 240, 240)", |
| 121 | + }, |
| 122 | +) |
| 123 | +move-cursor-to: "#help-button" |
| 124 | +assert-css: ( |
| 125 | + "#help-button:hover", |
| 126 | + {"border-color": "rgb(221, 221, 221)"}, |
| 127 | +) |
| 128 | +// Only "border-color" should change. |
| 129 | +assert-css: ( |
| 130 | + "#help-button:hover > button", |
| 131 | + { |
| 132 | + "color": "rgb(0, 0, 0)", |
| 133 | + "border-color": "rgb(255, 185, 0)", |
| 134 | + "background-color": "rgb(240, 240, 240)", |
| 135 | + }, |
| 136 | +) |
| 137 | + |
| 138 | +assert-css: ( |
| 139 | + "#settings-menu", |
| 140 | + {"border-color": "rgb(221, 221, 221)"}, |
| 141 | +) |
| 142 | +assert-css: ( |
| 143 | + "#settings-menu > a", |
| 144 | + { |
| 145 | + "color": "rgb(0, 0, 0)", |
| 146 | + "border-color": "rgb(224, 224, 224)", |
| 147 | + "background-color": "rgb(240, 240, 240)", |
| 148 | + }, |
| 149 | +) |
| 150 | +move-cursor-to: "#settings-menu" |
| 151 | +assert-css: ( |
| 152 | + "#settings-menu:hover", |
| 153 | + {"border-color": "rgb(221, 221, 221)"}, |
| 154 | +) |
| 155 | +// Only "border-color" should change. |
| 156 | +assert-css: ( |
| 157 | + "#settings-menu:hover > a", |
| 158 | + { |
| 159 | + "color": "rgb(0, 0, 0)", |
| 160 | + "border-color": "rgb(255, 185, 0)", |
| 161 | + "background-color": "rgb(240, 240, 240)", |
| 162 | + }, |
| 163 | +) |
| 164 | + |
| 165 | +// Light theme |
| 166 | +local-storage: { |
| 167 | + "rustdoc-theme": "light", |
| 168 | + "rustdoc-use-system-theme": "false", |
| 169 | +} |
| 170 | +reload: |
| 171 | + |
| 172 | +assert-css: ( |
| 173 | + ".search-input", |
| 174 | + { |
| 175 | + "border-color": "rgb(224, 224, 224)", |
| 176 | + "background-color": "rgb(255, 255, 255)", |
| 177 | + "color": "rgb(0, 0, 0)", |
| 178 | + }, |
| 179 | +) |
| 180 | +focus: ".search-input" |
| 181 | +// Nothing should change. |
| 182 | +assert-css: ( |
| 183 | + ".search-input", |
| 184 | + { |
| 185 | + "border-color": "rgb(102, 175, 233)", |
| 186 | + "background-color": "rgb(255, 255, 255)", |
| 187 | + "color": "rgb(0, 0, 0)", |
| 188 | + }, |
| 189 | +) |
| 190 | + |
| 191 | +assert-css: ( |
| 192 | + "#help-button", |
| 193 | + {"border-color": "rgb(0, 0, 0)"}, |
| 194 | +) |
| 195 | +assert-css: ( |
| 196 | + "#help-button > button", |
| 197 | + { |
| 198 | + "color": "rgb(0, 0, 0)", |
| 199 | + "border-color": "rgb(224, 224, 224)", |
| 200 | + "background-color": "rgb(255, 255, 255)", |
| 201 | + }, |
| 202 | +) |
| 203 | +move-cursor-to: "#help-button" |
| 204 | +assert-css: ( |
| 205 | + "#help-button:hover", |
| 206 | + {"border-color": "rgb(0, 0, 0)"}, |
| 207 | +) |
| 208 | +// Only "border-color" should change. |
| 209 | +assert-css: ( |
| 210 | + "#help-button:hover > button", |
| 211 | + { |
| 212 | + "color": "rgb(0, 0, 0)", |
| 213 | + "border-color": "rgb(113, 113, 113)", |
| 214 | + "background-color": "rgb(255, 255, 255)", |
| 215 | + }, |
| 216 | +) |
| 217 | + |
| 218 | +assert-css: ( |
| 219 | + "#settings-menu", |
| 220 | + {"border-color": "rgb(0, 0, 0)"}, |
| 221 | +) |
| 222 | +assert-css: ( |
| 223 | + "#settings-menu > a", |
| 224 | + { |
| 225 | + "color": "rgb(56, 115, 173)", |
| 226 | + "border-color": "rgb(224, 224, 224)", |
| 227 | + "background-color": "rgb(255, 255, 255)", |
| 228 | + }, |
| 229 | +) |
| 230 | +move-cursor-to: "#settings-menu" |
| 231 | +assert-css: ( |
| 232 | + "#settings-menu:hover", |
| 233 | + {"border-color": "rgb(0, 0, 0)"}, |
| 234 | +) |
| 235 | +// Only "border-color" should change. |
| 236 | +assert-css: ( |
| 237 | + "#settings-menu:hover > a", |
| 238 | + { |
| 239 | + "color": "rgb(56, 115, 173)", |
| 240 | + "border-color": "rgb(113, 113, 113)", |
| 241 | + "background-color": "rgb(255, 255, 255)", |
| 242 | + }, |
| 243 | +) |
0 commit comments