1
1
// Check that the line number column has the correct layout.
2
2
go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
3
3
4
+ set-window-size: (1000, 1000)
5
+
4
6
// Check that it's not zero.
5
7
assert-property-false: (
6
8
".more-scraped-examples .scraped-example .src-line-numbers",
@@ -33,6 +35,18 @@ assert-property: (
33
35
{"clientWidth": |clientWidth|}
34
36
)
35
37
38
+ // The "title" should be located at the right bottom corner of the code example.
39
+ store-position: (".example-wrap.scraped-example", {"x": x, "y": y})
40
+ store-size: (".example-wrap.scraped-example", {"width": width, "height": height})
41
+ store-size: (".example-wrap.scraped-example .scraped-example-title", {
42
+ "width": title_width,
43
+ "height": title_height,
44
+ })
45
+ assert-position: (".example-wrap.scraped-example .scraped-example-title", {
46
+ "x": |x| + |width| - |title_width| - 5,
47
+ "y": |y| + |height| - |title_height| - 8,
48
+ })
49
+
36
50
// Check that for both mobile and desktop sizes, the buttons in scraped examples are displayed
37
51
// correctly.
38
52
@@ -46,3 +60,24 @@ assert-position: (".scraped-example .prev", {"y": 226 + |offset_y|})
46
60
set-window-size: (600, 600)
47
61
assert-position: (".scraped-example", {"y": 284})
48
62
assert-position: (".scraped-example .prev", {"y": 284 + |offset_y|})
63
+
64
+ define-function: (
65
+ "check_title_position",
66
+ [],
67
+ block {
68
+ store-position: (".example-wrap.scraped-example .src-line-numbers", {"x": x, "y": y})
69
+ store-size: (".example-wrap.scraped-example .scraped-example-title", { "height": title_height })
70
+
71
+ assert-position: (".example-wrap.scraped-example .scraped-example-title", {
72
+ "x": |x|, // same X position.
73
+ "y": |y| - |title_height|,
74
+ })
75
+ }
76
+ )
77
+
78
+ // Check that the title is now above the code.
79
+ call-function: ("check_title_position", {})
80
+
81
+ // Then with small mobile
82
+ set-window-size: (300, 300)
83
+ call-function: ("check_title_position", {})
0 commit comments