Skip to content

Commit

Permalink
Update GUI tests for documentation indent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 14, 2024
1 parent f750450 commit 3a03f86
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
8 changes: 6 additions & 2 deletions tests/rustdoc-gui/deref-block.goml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ assert-css: (".big-toggle summary::before", {
"left": "-11px",
"top": "9px",
})
// It should have the same X position as the other toggles.
compare-elements-position: (".big-toggle summary::before", ".method-toggle summary::before", ["x"])
// It should have a slightly different X position as the other toggles.
store-position: (".big-toggle summary::before", {"x": big_toggle})
store-position: (".method-toggle summary::before", {"x": small_toggle})
assert: |big_toggle| < |small_toggle|
// Margin is 0.5em so around 8 px.
assert: |small_toggle| - |big_toggle| < 10
// But still shouldn't have the same Y position.
compare-elements-position-false: (
".big-toggle summary::before",
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-gui/docblock-table-overflow.goml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ compare-elements-property: (
"#implementations-list > details .docblock > p",
["scrollWidth"],
)
assert-property: ("#implementations-list > details .docblock", {"scrollWidth": "816"})
assert-property: ("#implementations-list > details .docblock", {"scrollWidth": "832"})
// However, since there is overflow in the <table>, its scroll width is bigger.
assert-property: ("#implementations-list > details .docblock table", {"scrollWidth": "1572"})
2 changes: 1 addition & 1 deletion tests/rustdoc-gui/item-info.goml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ store-position: (
"//*[@class='stab portability']//code[normalize-space()='Win32_System_Diagnostics']",
{"x": second_line_x, "y": second_line_y},
)
assert: |first_line_x| != |second_line_x| && |first_line_x| == 516 && |second_line_x| == 272
assert: |first_line_x| != |second_line_x| && |first_line_x| == 524 && |second_line_x| == 280
assert: |first_line_y| != |second_line_y| && |first_line_y| == 714 && |second_line_y| == 737

// Now we ensure that they're not rendered on the same line.
Expand Down
14 changes: 7 additions & 7 deletions tests/rustdoc-gui/notable-trait.goml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ define-function: (
// We start with a wide screen.
set-window-size: (1100, 600)
call-function: ("check-notable-tooltip-position-complete", {
"x": 677,
"i_x": 955,
"popover_x": 463,
"x": 685,
"i_x": 963,
"popover_x": 471,
})

// Now only the `i` should be on the next line.
Expand All @@ -78,16 +78,16 @@ compare-elements-position-false: (
// Now both the `i` and the struct name should be on the next line.
set-window-size: (980, 600)
call-function: ("check-notable-tooltip-position", {
"x": 245,
"i_x": 523,
"x": 253,
"i_x": 531,
})

// Checking on mobile now.
set-window-size: (650, 600)
wait-for-size: ("body", {"width": 650})
call-function: ("check-notable-tooltip-position-complete", {
"x": 25,
"i_x": 303,
"x": 23,
"i_x": 301,
"popover_x": 0,
})

Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-gui/toggle-docs-mobile.goml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ 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",
{"x": 4},
{"x": 12},
)

// Now we do the same but with a little bigger width
Expand Down

0 comments on commit 3a03f86

Please sign in to comment.