about summary refs log tree commit diff
path: root/tests/rustdoc-gui/docblock-table-overflow.goml
diff options
context:
space:
mode:
authorAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-05 09:13:28 +0100
committerAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-11 09:32:08 +0000
commitcf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch)
tree40a88d9a46aaf3e8870676eb2538378b75a263eb /tests/rustdoc-gui/docblock-table-overflow.goml
parentca855e6e42787ecd062d81d53336fe6788ef51a9 (diff)
downloadrust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.tar.gz
rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.zip
Move /src/test to /tests
Diffstat (limited to 'tests/rustdoc-gui/docblock-table-overflow.goml')
-rw-r--r--tests/rustdoc-gui/docblock-table-overflow.goml21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/rustdoc-gui/docblock-table-overflow.goml b/tests/rustdoc-gui/docblock-table-overflow.goml
new file mode 100644
index 00000000000..d8670089ad8
--- /dev/null
+++ b/tests/rustdoc-gui/docblock-table-overflow.goml
@@ -0,0 +1,21 @@
+// This test ensures that the type declaration content overflow is handled inside the <pre> directly.
+goto: "file://" + |DOC_PATH| + "/lib2/long_table/struct.Foo.html"
+// We set a fixed size so there is no chance of "random" resize.
+size: (1100, 800)
+// Logically, the ".docblock" and the "<p>" should have the same scroll width.
+compare-elements-property: (".top-doc .docblock", ".top-doc .docblock > p", ["scrollWidth"])
+assert-property: (".top-doc .docblock", {"scrollWidth": "816"})
+// However, since there is overflow in the <table>, its scroll width is bigger.
+assert-property: (".top-doc .docblock table", {"scrollWidth": "1572"})
+
+// Checking it works on other doc blocks as well...
+
+// Logically, the ".docblock" and the "<p>" should have the same scroll width.
+compare-elements-property: (
+    "#implementations-list > details .docblock",
+    "#implementations-list > details .docblock > p",
+    ["scrollWidth"],
+)
+assert-property: ("#implementations-list > details .docblock", {"scrollWidth": "816"})
+// However, since there is overflow in the <table>, its scroll width is bigger.
+assert-property: ("#implementations-list > details .docblock table", {"scrollWidth": "1572"})