diff options
| author | Michael Howell <michael@notriddle.com> | 2023-01-10 11:35:37 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2023-01-13 12:38:03 -0700 |
| commit | 1d328de3ec00bc5d204306da20cc166e5ae8857d (patch) | |
| tree | 3c517108a2e3948d6e5b72bf6b9d2422b177813e /tests/rustdoc-gui | |
| parent | 0b90256ada21c6a81b4c18f2c7a23151ab5fc232 (diff) | |
| download | rust-1d328de3ec00bc5d204306da20cc166e5ae8857d.tar.gz rust-1d328de3ec00bc5d204306da20cc166e5ae8857d.zip | |
rustdoc: rename CSS rustdoc-toggle -> toggle and toggle -> settings-toggle
This swaps things around so that the class that gets used more often has the shorter name.
Diffstat (limited to 'tests/rustdoc-gui')
| -rw-r--r-- | tests/rustdoc-gui/method-margins.goml | 10 | ||||
| -rw-r--r-- | tests/rustdoc-gui/settings.goml | 4 | ||||
| -rw-r--r-- | tests/rustdoc-gui/toggle-click-deadspace.goml | 8 | ||||
| -rw-r--r-- | tests/rustdoc-gui/toggle-docs.goml | 18 | ||||
| -rw-r--r-- | tests/rustdoc-gui/toggled-open-implementations.goml | 2 |
5 files changed, 21 insertions, 21 deletions
diff --git a/tests/rustdoc-gui/method-margins.goml b/tests/rustdoc-gui/method-margins.goml index ed36bcdec17..720268a9e7e 100644 --- a/tests/rustdoc-gui/method-margins.goml +++ b/tests/rustdoc-gui/method-margins.goml @@ -1,18 +1,18 @@ // This test ensures that the margins on methods are coherent inside an impl block. goto: "file://" + |DOC_PATH| + "/test_docs/trait_members/struct.HasTrait.html#impl-TraitMembers-for-HasTrait" -assert-count: ("#trait-implementations-list > .rustdoc-toggle", 1) +assert-count: ("#trait-implementations-list > .toggle", 1) compare-elements-css: ( // compare margin on type with margin on method - "#trait-implementations-list .impl-items > .rustdoc-toggle:nth-child(1) > summary", - "#trait-implementations-list .impl-items > .rustdoc-toggle:nth-child(2) > summary", + "#trait-implementations-list .impl-items > .toggle:nth-child(1) > summary", + "#trait-implementations-list .impl-items > .toggle:nth-child(2) > summary", ["margin"] ) compare-elements-css: ( // compare margin on type with margin on method - "#trait-implementations-list .impl-items > .rustdoc-toggle:nth-child(1)", - "#trait-implementations-list .impl-items > .rustdoc-toggle:nth-child(2)", + "#trait-implementations-list .impl-items > .toggle:nth-child(1)", + "#trait-implementations-list .impl-items > .toggle:nth-child(2)", ["margin"] ) diff --git a/tests/rustdoc-gui/settings.goml b/tests/rustdoc-gui/settings.goml index fc3beaa53fa..f236dc3e0fe 100644 --- a/tests/rustdoc-gui/settings.goml +++ b/tests/rustdoc-gui/settings.goml @@ -159,7 +159,7 @@ assert-text: ("#preferred-light-theme .setting-name", "Preferred light theme") // We now check that clicking on the toggles' text is like clicking on the checkbox. // To test it, we use the "Disable keyboard shortcuts". local-storage: {"rustdoc-disable-shortcuts": "false"} -click: ".setting-line:last-child .toggle .label" +click: ".setting-line:last-child .settings-toggle .label" assert-local-storage: {"rustdoc-disable-shortcuts": "true"} // Make sure that "Disable keyboard shortcuts" actually took effect. @@ -169,7 +169,7 @@ assert-false: "#help-button .popover" wait-for-css: ("#settings-menu .popover", {"display": "block"}) // Now turn keyboard shortcuts back on, and see if they work. -click: ".setting-line:last-child .toggle .label" +click: ".setting-line:last-child .settings-toggle .label" assert-local-storage: {"rustdoc-disable-shortcuts": "false"} press-key: "Escape" press-key: "?" diff --git a/tests/rustdoc-gui/toggle-click-deadspace.goml b/tests/rustdoc-gui/toggle-click-deadspace.goml index 029403ee13e..689e562f730 100644 --- a/tests/rustdoc-gui/toggle-click-deadspace.goml +++ b/tests/rustdoc-gui/toggle-click-deadspace.goml @@ -1,14 +1,14 @@ // This test ensures that clicking on a method summary, but not on the "[-]", // doesn't toggle the <details>. goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html" -assert-attribute: (".impl-items .rustdoc-toggle", {"open": ""}) +assert-attribute: (".impl-items .toggle", {"open": ""}) click: "h4.code-header" // This is the position of "pub" in "pub fn a_method" -assert-attribute: (".impl-items .rustdoc-toggle", {"open": ""}) +assert-attribute: (".impl-items .toggle", {"open": ""}) click-with-offset: ( - ".impl-items .rustdoc-toggle summary", + ".impl-items .toggle summary", {"x": -24, "y": 8}, // This is the position of "[-]" next to that pub fn. ) -assert-attribute-false: (".impl-items .rustdoc-toggle", {"open": ""}) +assert-attribute-false: (".impl-items .toggle", {"open": ""}) // Click the "Trait" part of "impl Trait" and verify it navigates. click: "#impl-Trait-for-Foo h3 a:first-of-type" diff --git a/tests/rustdoc-gui/toggle-docs.goml b/tests/rustdoc-gui/toggle-docs.goml index 89ce78e3aab..c9d236e9bba 100644 --- a/tests/rustdoc-gui/toggle-docs.goml +++ b/tests/rustdoc-gui/toggle-docs.goml @@ -20,10 +20,10 @@ assert-text: ("#toggle-all-docs", "[−]") goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" // We first check that everything is visible. assert-text: ("#toggle-all-docs", "[−]") -assert-attribute: ("#implementations-list details.rustdoc-toggle", {"open": ""}, ALL) -assert-attribute: ("#trait-implementations-list details.rustdoc-toggle", {"open": ""}, ALL) +assert-attribute: ("#implementations-list details.toggle", {"open": ""}, ALL) +assert-attribute: ("#trait-implementations-list details.toggle", {"open": ""}, ALL) assert-attribute-false: ( - "#blanket-implementations-list > details.rustdoc-toggle", + "#blanket-implementations-list > details.toggle", {"open": ""}, ALL, ) @@ -32,18 +32,18 @@ assert-attribute-false: ( click: "#toggle-all-docs" wait-for-text: ("#toggle-all-docs", "[+]") // We check that all <details> are collapsed (except for the impl block ones). -assert-attribute-false: ("details.rustdoc-toggle:not(.implementors-toggle)", {"open": ""}, ALL) +assert-attribute-false: ("details.toggle:not(.implementors-toggle)", {"open": ""}, ALL) assert-attribute: ("#implementations-list > details.implementors-toggle", {"open": ""}) // We now check that the other impl blocks are collapsed. assert-attribute-false: ( - "#blanket-implementations-list > details.rustdoc-toggle.implementors-toggle", + "#blanket-implementations-list > details.toggle.implementors-toggle", {"open": ""}, ALL, ) // We open them all again. click: "#toggle-all-docs" wait-for-text: ("#toggle-all-docs", "[−]") -assert-attribute: ("details.rustdoc-toggle", {"open": ""}, ALL) +assert-attribute: ("details.toggle", {"open": ""}, ALL) // Checking the toggles style. show-text: true @@ -56,12 +56,12 @@ define-function: ( // We reload the page so the local storage settings are being used. reload: - assert-css: ("details.rustdoc-toggle > summary::before", { + assert-css: ("details.toggle > summary::before", { "opacity": "0.5", "filter": |filter|, }, ALL) - move-cursor-to: "details.rustdoc-toggle summary" - assert-css: ("details.rustdoc-toggle > summary:hover::before", { + move-cursor-to: "details.toggle summary" + assert-css: ("details.toggle > summary:hover::before", { "opacity": "1", "filter": |filter|, }) diff --git a/tests/rustdoc-gui/toggled-open-implementations.goml b/tests/rustdoc-gui/toggled-open-implementations.goml index e4d59b5d728..000293b555f 100644 --- a/tests/rustdoc-gui/toggled-open-implementations.goml +++ b/tests/rustdoc-gui/toggled-open-implementations.goml @@ -2,4 +2,4 @@ // has all the implementations toggled open by default, so users can // find method names in those implementations with Ctrl-F. goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" -assert-attribute: (".rustdoc-toggle.implementors-toggle", {"open": ""}) +assert-attribute: (".toggle.implementors-toggle", {"open": ""}) |
