summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-gui/item-decl-colors.goml
blob: a777842735c246a3ee8b5b084b25c0aeb6aaaf07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// This test ensures that the color of the items in the type decl are working as expected.

// We need to disable this check because `implementors/test_docs/trait.TraitWithoutGenerics.js`
// doesn't exist.
fail-on-request-error: false

define-function: (
    "check-colors",
    (
        theme,
        attr_color,
        trait_color,
        struct_color,
        enum_color,
        primitive_color,
        constant_color,
        fn_color,
        assoc_type_color,
    ),
    block {
        go-to: "file://" + |DOC_PATH| + "/test_docs/struct.WithGenerics.html"
        show-text: true

        set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
        reload:
        assert-css: (".item-decl .code-attribute", {"color": |attr_color|}, ALL)
        assert-css: (".item-decl .trait", {"color": |trait_color|}, ALL)
        // We need to add `code` here because otherwise it would select the parent too.
        assert-css: (".item-decl code .struct", {"color": |struct_color|}, ALL)
        assert-css: (".item-decl .enum", {"color": |enum_color|}, ALL)
        assert-css: (".item-decl .primitive", {"color": |primitive_color|}, ALL)

        go-to: "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithoutGenerics.html"
        assert-css: (".item-decl .constant", {"color": |constant_color|}, ALL)
        assert-css: (".item-decl .fn", {"color": |fn_color|}, ALL)
        assert-css: (".item-decl .associatedtype", {"color": |assoc_type_color|}, ALL)
    },
)

call-function: (
    "check-colors",
    {
        "theme": "ayu",
        "attr_color": "#999",
        "trait_color": "#39afd7",
        "struct_color": "#ffa0a5",
        "enum_color": "#ffa0a5",
        "primitive_color": "#ffa0a5",
        "constant_color": "#39afd7",
        "fn_color": "#fdd687",
        "assoc_type_color": "#39afd7",
    },
)
call-function: (
    "check-colors",
    {
        "theme": "dark",
        "attr_color": "#999",
        "trait_color": "#b78cf2",
        "struct_color": "#2dbfb8",
        "enum_color": "#2dbfb8",
        "primitive_color": "#2dbfb8",
        "constant_color": "#d2991d",
        "fn_color": "#2bab63",
        "assoc_type_color": "#d2991d",
    },
)
call-function: (
    "check-colors",
    {
        "theme": "light",
        "attr_color": "#999",
        "trait_color": "#6e4fc9",
        "struct_color": "#ad378a",
        "enum_color": "#ad378a",
        "primitive_color": "#ad378a",
        "constant_color": "#3873ad",
        "fn_color": "#ad7c37",
        "assoc_type_color": "#3873ad",
    },
)