|
| 1 | +// Test to check that the "warning blocks" are displayed as expected. |
| 2 | +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" |
| 3 | +show-text: true |
| 4 | + |
| 5 | +define-function: ( |
| 6 | + "check-warning", |
| 7 | + (theme, color, border_color, background_color), |
| 8 | + block { |
| 9 | + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} |
| 10 | + reload: |
| 11 | + |
| 12 | + // The IDs are added directly into the DOM to make writing this test easier. |
| 13 | + assert-css: ("#doc-warning-1", { |
| 14 | + "margin-bottom": "12px", |
| 15 | + "color": |color|, |
| 16 | + "border-left": "2px solid " + |border_color|, |
| 17 | + "background-color": |background_color|, |
| 18 | + }) |
| 19 | + assert-css: ("#doc-warning-2", { |
| 20 | + "margin-bottom": "0px", |
| 21 | + "color": |color|, |
| 22 | + "border-left": "2px solid " + |border_color|, |
| 23 | + "background-color": |background_color|, |
| 24 | + }) |
| 25 | + }, |
| 26 | +) |
| 27 | + |
| 28 | +call-function: ("check-warning", { |
| 29 | + "theme": "ayu", |
| 30 | + "color": "rgb(197, 197, 197)", |
| 31 | + "border_color": "rgb(255, 142, 0)", |
| 32 | + "background_color": "rgba(0, 0, 0, 0)", |
| 33 | +}) |
| 34 | +call-function: ("check-warning", { |
| 35 | + "theme": "dark", |
| 36 | + "color": "rgb(221, 221, 221)", |
| 37 | + "border_color": "rgb(255, 142, 0)", |
| 38 | + "background_color": "rgba(0, 0, 0, 0)", |
| 39 | +}) |
| 40 | +call-function: ("check-warning", { |
| 41 | + "theme": "light", |
| 42 | + "color": "rgb(0, 0, 0)", |
| 43 | + "border_color": "rgb(255, 142, 0)", |
| 44 | + "background_color": "rgba(0, 0, 0, 0)", |
| 45 | +}) |
0 commit comments