Skip to content

Commit 4f20626

Browse files
Update GUI tests for documentation indent changes
1 parent 8fb6c08 commit 4f20626

7 files changed

+18
-13
lines changed

tests/rustdoc-gui/deref-block.goml

+6-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ assert-css: (".big-toggle summary::before", {
2020
"left": "-11px",
2121
"top": "9px",
2222
})
23-
// It should have the same X position as the other toggles.
24-
compare-elements-position: (".big-toggle summary::before", ".method-toggle summary::before", ["x"])
23+
// It should have a slightly different X position as the other toggles.
24+
store-position: (".big-toggle summary::before", {"x": big_toggle})
25+
store-position: (".method-toggle summary::before", {"x": small_toggle})
26+
assert: |big_toggle| < |small_toggle|
27+
// Margin is 0.5em so around 8 px.
28+
assert: |small_toggle| - |big_toggle| < 10
2529
// But still shouldn't have the same Y position.
2630
compare-elements-position-false: (
2731
".big-toggle summary::before",

tests/rustdoc-gui/docblock-table-overflow.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ compare-elements-property: (
1616
"#implementations-list > details .docblock > p",
1717
["scrollWidth"],
1818
)
19-
assert-property: ("#implementations-list > details .docblock", {"scrollWidth": "816"})
19+
assert-property: ("#implementations-list > details .docblock", {"scrollWidth": "832"})
2020
// However, since there is overflow in the <table>, its scroll width is bigger.
2121
assert-property: ("#implementations-list > details .docblock table", {"scrollWidth": "1572"})

tests/rustdoc-gui/item-info-alignment.goml

+2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ go-to: "file://" + |DOC_PATH| + "/lib2/struct.ItemInfoAlignmentTest.html"
44

55
// First, we try it in "desktop" mode.
66
set-window-size: (1200, 870)
7+
wait-for-size: ("body", {"width": 1200})
78
compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ["x"])
89
// Next, we try it in "mobile" mode (max-width: 700px).
910
set-window-size: (650, 650)
11+
wait-for-size: ("body", {"width": 650})
1012
compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ["x"])

tests/rustdoc-gui/item-info.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ store-position: (
1919
"//*[@class='stab portability']//code[normalize-space()='Win32_System_Diagnostics']",
2020
{"x": second_line_x, "y": second_line_y},
2121
)
22-
assert: |first_line_x| != |second_line_x| && |first_line_x| == 516 && |second_line_x| == 272
22+
assert: |first_line_x| != |second_line_x| && |first_line_x| == 524 && |second_line_x| == 280
2323
assert: |first_line_y| != |second_line_y| && |first_line_y| == 718 && |second_line_y| == 741
2424

2525
// Now we ensure that they're not rendered on the same line.

tests/rustdoc-gui/methods-left-margin.goml

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// This test is to ensure that methods are correctly aligned on the left side.
22

33
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
4-
54
// First we ensure that we have methods with and without documentation.
65
assert: ".impl-items > details.method-toggle > summary > section.method"
76
assert: ".impl-items > section.method"

tests/rustdoc-gui/notable-trait.goml

+7-7
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ define-function: (
6262
// We start with a wide screen.
6363
set-window-size: (1100, 600)
6464
call-function: ("check-notable-tooltip-position-complete", {
65-
"x": 677,
66-
"i_x": 955,
67-
"popover_x": 463,
65+
"x": 685,
66+
"i_x": 963,
67+
"popover_x": 471,
6868
})
6969

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

8585
// Checking on mobile now.
8686
set-window-size: (650, 600)
8787
wait-for-size: ("body", {"width": 650})
8888
call-function: ("check-notable-tooltip-position-complete", {
89-
"x": 25,
90-
"i_x": 303,
89+
"x": 26,
90+
"i_x": 305,
9191
"popover_x": 0,
9292
})
9393

tests/rustdoc-gui/toggle-docs-mobile.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ assert-position: ("#implementations-list > details > summary::before", {"x": 4})
1818
// Assert the position of the toggle on a method.
1919
assert-position: (
2020
"#trait-implementations-list .impl-items .method-toggle > summary::before",
21-
{"x": 4},
21+
{"x": 6},
2222
)
2323

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

0 commit comments

Comments
 (0)