Skip to content

Commit

Permalink
Update GUI tests for impl blocks path changes
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 8, 2022
1 parent a5216cf commit fbd9c28
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/test/rustdoc-gui/docblock-table-overflow.goml
Expand Up @@ -12,10 +12,10 @@ assert-property: (".top-doc .docblock table", {"scrollWidth": "1573"})

// Logically, the ".docblock" and the "<p>" should have the same scroll width.
compare-elements-property: (
"#implementations + details .docblock",
"#implementations + details .docblock > p",
"#implementations-list > details .docblock",
"#implementations-list > details .docblock > p",
["scrollWidth"],
)
assert-property: ("#implementations + details .docblock", {"scrollWidth": "801"})
assert-property: ("#implementations-list > details .docblock", {"scrollWidth": "801"})
// However, since there is overflow in the <table>, its scroll width is bigger.
assert-property: ("#implementations + details .docblock table", {"scrollWidth": "1573"})
assert-property: ("#implementations-list > details .docblock table", {"scrollWidth": "1573"})
4 changes: 2 additions & 2 deletions src/test/rustdoc-gui/hash-item-expansion.goml
Expand Up @@ -3,9 +3,9 @@ goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.borrow
// In the blanket implementations list, "Borrow" is the second one, hence the ":nth(2)".
assert-attribute: ("#blanket-implementations-list > details:nth-child(2)", {"open": ""})
// We first check that the impl block is open by default.
assert-attribute: ("#implementations + details", {"open": ""})
assert-attribute: ("#implementations-list details", {"open": ""})
// To ensure that we will click on the currently hidden method.
assert-text: (".sidebar-elems section .block li > a", "must_use")
click: ".sidebar-elems section .block li > a"
// We check that the impl block was opened as expected so that we can see the method.
assert-attribute: ("#implementations + details", {"open": ""})
assert-attribute: ("#implementations-list > details", {"open": ""})
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/impl-default-expansion.goml
@@ -1,3 +1,3 @@
// This test ensures that the impl blocks are open by default.
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
assert-attribute: ("#main-content > details.implementors-toggle", {"open": ""})
assert-attribute: ("#implementations-list details.implementors-toggle", {"open": ""})
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/toggle-docs-mobile.goml
Expand Up @@ -14,7 +14,7 @@ assert-attribute: (".top-doc", {"open": ""})
// Assert the position of the toggle on the top doc block.
assert-position: (".top-doc summary::before", {"x": 4})
// Assert the position of the toggle on the impl block.
assert-position: ("#implementations + details > summary::before", {"x": 4})
assert-position: ("#implementations-list > details > summary::before", {"x": 4})
// Assert the position of the toggle on a method.
assert-position: (
"#trait-implementations-list .impl-items .method-toggle > summary::before",
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/toggle-docs.goml
Expand Up @@ -24,7 +24,7 @@ wait-for: 50
assert-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: ("details.rustdoc-toggle.implementors-toggle", {"open": ""})
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",
Expand Down
2 changes: 2 additions & 0 deletions src/test/rustdoc/duplicate_impls/issue-33054.rs
@@ -1,3 +1,5 @@
// ignore-tidy-linelength

// @has issue_33054/impls/struct.Foo.html
// @has - '//h3[@class="code-header in-band"]' 'impl Foo'
// @has - '//h3[@class="code-header in-band"]' 'impl Bar for Foo'
Expand Down

0 comments on commit fbd9c28

Please sign in to comment.