From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/rustdoc-gui/label-next-to-symbol.goml | 78 ++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 src/test/rustdoc-gui/label-next-to-symbol.goml (limited to 'src/test/rustdoc-gui/label-next-to-symbol.goml') diff --git a/src/test/rustdoc-gui/label-next-to-symbol.goml b/src/test/rustdoc-gui/label-next-to-symbol.goml new file mode 100644 index 000000000..ca3994a08 --- /dev/null +++ b/src/test/rustdoc-gui/label-next-to-symbol.goml @@ -0,0 +1,78 @@ +// These tests verify that labels like "UNIX" and "Deprecated" stay on the same line as their symbol. +// It also verifies the staggered layout on mobile. +goto: file://|DOC_PATH|/test_docs/index.html + +// Desktop view +size: (1080, 600) +assert: (".stab.deprecated") +assert: (".stab.portability") + +// make sure that deprecated and portability are different colours +assert-css: ( + ".item-table .item-left .stab.deprecated", + { "background-color": "rgb(255, 196, 196)" }, +) +assert-css: ( + ".item-table .item-left .stab.portability", + { "background-color": "rgb(243, 223, 255)" }, +) + +// table like view +assert-css: (".item-right.docblock-short", { "padding-left": "0px" }) +compare-elements-position-near: ( + "//*[@class='item-left module-item']//a[text()='replaced_function']", + ".item-left .stab.deprecated", + {"y": 2}, +) +compare-elements-position: ( + ".item-left .stab.deprecated", + ".item-left .stab.portability", + ("y"), +) + +// Ensure no wrap +compare-elements-position-near: ( + "//*[@class='item-left module-item']//a[text()='replaced_function']", + "//*[@class='item-right docblock-short']//p[text()='a thing with a label']", + {"y": 2}, +) +// compare parent elements +compare-elements-position: ( + "//*[@class='item-left module-item']//a[text()='replaced_function']/..", + "//*[@class='item-right docblock-short']//p[text()='a thing with a label']/..", + ("y"), +) + + +// Mobile view +size: (600, 600) +// staggered layout with 2em spacing +assert-css: (".item-right.docblock-short", { "padding-left": "32px" }) +compare-elements-position-near: ( + "//*[@class='item-left module-item']//a[text()='replaced_function']", + ".item-left .stab.deprecated", + {"y": 1}, +) +compare-elements-position: ( + ".item-left .stab.deprecated", + ".item-left .stab.portability", + ("y"), +) + +// Ensure wrap +compare-elements-position-near-false: ( + "//*[@class='item-left module-item']//a[text()='replaced_function']", + "//*[@class='item-right docblock-short']//p[text()='a thing with a label']", + {"y": 12}, +) +// compare parent elements +compare-elements-position-false: ( + "//*[@class='item-left module-item']//a[text()='replaced_function']/..", + "//*[@class='item-right docblock-short']//p[text()='a thing with a label']/..", + ("y"), +) +compare-elements-position-false: ( + ".item-left .stab.deprecated", + "//*[@class='item-right docblock-short']//p[text()='a thing with a label']", + ("y"), +) -- cgit v1.2.3