Skip to content

Commit

Permalink
Update GUI tests for logo display on very small screens
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Apr 5, 2023
1 parent 906bdd3 commit 8f5404d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/rustdoc-gui/huge-logo.goml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ size: (1280, 1024)
assert-property: (".sub-logo-container", {"offsetWidth": "60", "offsetHeight": 60})

size: (400, 600)
assert-property: (".sub-logo-container", {"offsetWidth": "35", "offsetHeight": 35})
// 43 because 35px + 8px of margin
assert-css: (".sub-logo-container > img", {"margin-bottom": "8px"})
assert-property: (".sub-logo-container", {"offsetWidth": "35", "offsetHeight": 43})
5 changes: 5 additions & 0 deletions tests/rustdoc-gui/source-code-page.goml
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,8 @@ call-function: ("check-sidebar-dir-entry", {
"x": 0,
"y": |source_sidebar_title_y| + |source_sidebar_title_height| + 6,
})

// Now we check that the logo has a bottom margin so it's not stuck to the search input.
assert-css: (".sub-logo-container > img", {"margin-bottom": "8px"})
store-property: (logo_height, ".sub-logo-container", "clientHeight")
assert-position: (".search-form", {"y": |logo_height| + 8})

0 comments on commit 8f5404d

Please sign in to comment.