Skip to content

Commit

Permalink
Strenghten GUI test to include extra state in selector
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 24, 2022
1 parent 6fc52c6 commit e6a4008
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/test/rustdoc-gui/sidebar-source-code-display.goml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,17 @@ define-function: (
("assert-css", ("#sidebar-toggle > button", {"background-color": |background_toggle|})),
// With focus.
("focus", "#sidebar-toggle > button"),
("assert-css", ("#sidebar-toggle > button", {"background-color": |background_toggle_hover|})),
("assert-css", (
"#sidebar-toggle > button:focus",
{"background-color": |background_toggle_hover|},
)),
("focus", ".search-input"),
// With hover.
("move-cursor-to", "#sidebar-toggle > button"),
("assert-css", ("#sidebar-toggle > button", {"background-color": |background_toggle_hover|})),
("assert-css", (
"#sidebar-toggle > button:hover",
{"background-color": |background_toggle_hover|},
)),

// Without hover or focus.
("assert-css", (
Expand All @@ -62,14 +68,14 @@ define-function: (
// With focus.
("focus", "#source-sidebar details[open] > .files a:not(.selected)"),
("wait-for-css", (
"#source-sidebar details[open] > .files a:not(.selected)",
"#source-sidebar details[open] > .files a:not(.selected):focus",
{"color": |color_hover|, "background-color": |background_hover|},
)),
("focus", ".search-input"),
// With hover.
("move-cursor-to", "#source-sidebar details[open] > .files a:not(.selected)"),
("assert-css", (
"#source-sidebar details[open] > .files a:not(.selected)",
"#source-sidebar details[open] > .files a:not(.selected):hover",
{"color": |color_hover|, "background-color": |background_hover|},
)),

Expand Down Expand Up @@ -100,14 +106,14 @@ define-function: (
// With focus.
("focus", "#source-sidebar details[open] > .folders > details > summary"),
("wait-for-css", (
"#source-sidebar details[open] > .folders > details > summary",
"#source-sidebar details[open] > .folders > details > summary:focus",
{"color": |color_hover|, "background-color": |background_hover|},
)),
("focus", ".search-input"),
// With hover.
("move-cursor-to", "#source-sidebar details[open] > .folders > details > summary"),
("assert-css", (
"#source-sidebar details[open] > .folders > details > summary",
"#source-sidebar details[open] > .folders > details > summary:hover",
{"color": |color_hover|, "background-color": |background_hover|},
)),
],
Expand Down

0 comments on commit e6a4008

Please sign in to comment.