Skip to content

Commit

Permalink
Make use of wait-for*-false commands
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Sep 28, 2024
1 parent 62cbd2b commit 2f16ff7
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions tests/rustdoc-gui/docblock-code-block-line-number.goml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ assert-css: ("#settings", {"display": "block"})

// Then, click the toggle button.
click: "input#line-numbers"
wait-for: 100 // FIXME: `wait-for-false` does not exist
assert-false: "pre.example-line-numbers"
wait-for-false: "pre.example-line-numbers"
assert-local-storage: {"rustdoc-line-numbers": "false" }

// Check that the rounded corners are back.
Expand All @@ -107,8 +106,7 @@ assert-css: (
click: "input#line-numbers"
wait-for: "pre.example-line-numbers"
assert-local-storage: {"rustdoc-line-numbers": "true" }
wait-for: 100 // FIXME: `wait-for-false` does not exist
assert: "pre.example-line-numbers"
wait-for: "pre.example-line-numbers"

// Same check with scraped examples line numbers.
go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
Expand Down Expand Up @@ -195,15 +193,13 @@ define-function: ("check-line-numbers-existence", [], block {

// Then, click the toggle button.
click: "input#line-numbers"
wait-for: 100 // FIXME: `wait-for-false` does not exist
assert-local-storage-false: {"rustdoc-line-numbers": "true" }
wait-for-local-storage-false: {"rustdoc-line-numbers": "true" }
assert-false: ".example-line-numbers"
// Line numbers should still be there.
assert: ".src-line-numbers"
// Now disabling the setting.
click: "input#line-numbers"
wait-for: 100 // FIXME: `wait-for-false` does not exist
assert-local-storage: {"rustdoc-line-numbers": "true" }
wait-for-local-storage: {"rustdoc-line-numbers": "true" }
assert-false: ".example-line-numbers"
// Line numbers should still be there.
assert: ".src-line-numbers"
Expand Down Expand Up @@ -246,12 +242,10 @@ wait-for: "#settings"

// Then, click the toggle button.
click: "input#line-numbers"
wait-for: 100 // FIXME: `wait-for-false` does not exist
wait-for-count: (".example-wrap > pre.example-line-numbers", 0)
assert-local-storage-false: {"rustdoc-line-numbers": "true" }
assert-count: (".example-wrap > pre.example-line-numbers", 0)

// Now turning off the setting.
click: "input#line-numbers"
wait-for: 100 // FIXME: `wait-for-false` does not exist
wait-for-count: (".example-wrap > pre.example-line-numbers", 2)
assert-local-storage: {"rustdoc-line-numbers": "true" }
assert-count: (".example-wrap > pre.example-line-numbers", 2)

0 comments on commit 2f16ff7

Please sign in to comment.