Skip to content

Commit c27b54a

Browse files
committed
rustdoc-gui: fix test cases
1 parent 6683c04 commit c27b54a

5 files changed

+14
-14
lines changed

Diff for: tests/rustdoc-gui/scrape-examples-layout.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ assert-css: (".scraped-example .example-wrap::after", {"bottom": "0px"})
9090
// Then with mobile
9191
set-window-size: (600, 600)
9292
store-size: (".scraped-example .scraped-example-title", {"height": title_height})
93-
assert-position: (".scraped-example", {"y": 281})
94-
assert-position: (".scraped-example .prev", {"y": 281 + |offset_y| + |title_height|})
93+
assert-position: (".scraped-example", {"y": 287})
94+
assert-position: (".scraped-example .prev", {"y": 287 + |offset_y| + |title_height|})
9595

9696
define-function: (
9797
"check_title_and_code_position",

Diff for: tests/rustdoc-gui/search-result-display.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ set-text: (
6464
)
6565

6666
// Then we compare again to confirm the height didn't change.
67-
assert-size: ("#crate-search", {"width": 509})
67+
assert-size: ("#crate-search", {"width": 370})
6868
assert-size: (".search-results-title", {
6969
"height": |search_results_title_height|,
7070
})

Diff for: tests/rustdoc-gui/sidebar-source-code-display.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ click: "#sidebar-button"
141141
wait-for-css: (".src .sidebar > *", {"visibility": "hidden"})
142142
// We scroll to line 117 to change the scroll position.
143143
scroll-to: '//*[@id="117"]'
144-
store-value: (y_offset, "2564")
144+
store-value: (y_offset, "2570")
145145
assert-window-property: {"pageYOffset": |y_offset|}
146146
// Expanding the sidebar...
147147
click: "#sidebar-button"

Diff for: tests/rustdoc-gui/source-anchor-scroll.goml

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ set-window-size: (600, 800)
88
assert-property: ("html", {"scrollTop": "0"})
99

1010
click: '//a[text() = "barbar" and @href="#5-7"]'
11-
assert-property: ("html", {"scrollTop": "194"})
11+
assert-property: ("html", {"scrollTop": "200"})
1212
click: '//a[text() = "bar" and @href="#28-36"]'
13-
assert-property: ("html", {"scrollTop": "225"})
13+
assert-property: ("html", {"scrollTop": "231"})
1414
click: '//a[normalize-space() = "sub_fn" and @href="#2-4"]'
15-
assert-property: ("html", {"scrollTop": "122"})
15+
assert-property: ("html", {"scrollTop": "128"})
1616

1717
// We now check that clicking on lines doesn't change the scroll
1818
// Extra information: the "sub_fn" function header is on line 1.
1919
click: '//*[@id="6"]'
20-
assert-property: ("html", {"scrollTop": "122"})
20+
assert-property: ("html", {"scrollTop": "128"})

Diff for: tests/rustdoc-gui/toggle-docs-mobile.goml

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
44
set-window-size: (433, 600)
55
assert-attribute: (".top-doc", {"open": ""})
6-
click: (4, 260) // This is the position of the top doc comment toggle
6+
click: (4, 270) // This is the position of the top doc comment toggle
77
assert-attribute-false: (".top-doc", {"open": ""})
8-
click: (4, 260)
8+
click: (4, 270)
99
assert-attribute: (".top-doc", {"open": ""})
1010
// To ensure that the toggle isn't over the text, we check that the toggle isn't clicked.
11-
click: (3, 260)
11+
click: (3, 270)
1212
assert-attribute: (".top-doc", {"open": ""})
1313

1414
// Assert the position of the toggle on the top doc block.
@@ -24,10 +24,10 @@ assert-position: (
2424
// Now we do the same but with a little bigger width
2525
set-window-size: (600, 600)
2626
assert-attribute: (".top-doc", {"open": ""})
27-
click: (4, 260) // New Y position since all search elements are back on one line.
27+
click: (4, 270) // New Y position since all search elements are back on one line.
2828
assert-attribute-false: (".top-doc", {"open": ""})
29-
click: (4, 260)
29+
click: (4, 270)
3030
assert-attribute: (".top-doc", {"open": ""})
3131
// To ensure that the toggle isn't over the text, we check that the toggle isn't clicked.
32-
click: (3, 260)
32+
click: (3, 270)
3333
assert-attribute: (".top-doc", {"open": ""})

0 commit comments

Comments
 (0)