-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7526236
commit 5b554b6
Showing
2 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Test to ensure that the headings anchor behave as expected. | ||
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html" | ||
show-text: true | ||
|
||
define-function: ( | ||
"check-heading-anchor", | ||
(heading_id), | ||
block { | ||
// The anchor should not be displayed by default. | ||
assert-css: ("#" + |heading_id| + " .doc-anchor", { "display": "none" }) | ||
// We ensure that hovering the heading makes the anchor visible. | ||
move-cursor-to: "#" + |heading_id| | ||
assert-css: ("#" + |heading_id| + ":hover .doc-anchor", { "display": "block" }) | ||
// We then ensure that moving from the heading to the anchor doesn't make the anchor | ||
// disappear. | ||
move-cursor-to: "#" + |heading_id| + " .doc-anchor" | ||
assert-css: ("#" + |heading_id| + " .doc-anchor:hover", { | ||
"display": "block", | ||
// We also ensure that there is no underline decoration. | ||
"text-decoration-line": "none", | ||
}) | ||
} | ||
) | ||
|
||
move-cursor-to: "#top-doc-prose-title" | ||
// If the top documentation block first element is a heading, we should never display its anchor | ||
// to prevent it from overlapping with the `[-]` element. | ||
assert-css: ("#top-doc-prose-title:hover .doc-anchor", { "display": "none" }) | ||
|
||
call-function: ("check-heading-anchor", ("top-doc-prose-sub-heading")) | ||
call-function: ("check-heading-anchor", ("top-doc-prose-sub-sub-heading")) | ||
call-function: ("check-heading-anchor", ("you-know-the-drill")) |