| 1 |
// This test ensures that links with images render side by side and that the link element contains |
| 2 |
// the image entirely. |
| 3 |
|
| 4 |
set-window-size: (1100, 800) |
| 5 |
go-to: |DOC_PATH| + "basic/index.html" |
| 6 |
|
| 7 |
define-function: ( |
| 8 |
"check-link-and-img-size", |
| 9 |
[selector], |
| 10 |
block { |
| 11 |
store-size: (|selector|, {"width": link_width, "height": link_height}) |
| 12 |
store-size: (|selector| + "> img", {"width": img_width, "height": img_height}) |
| 13 |
assert: |link_width| >= |img_width| && |link_height| >= |img_height| |
| 14 |
} |
| 15 |
) |
| 16 |
|
| 17 |
// Both link (containing an image) should be on the same line. |
| 18 |
compare-elements-position: ( |
| 19 |
"a[href='link']:nth-child(1) > img", |
| 20 |
"a[href='link']:nth-child(2) > img", |
| 21 |
["y"], |
| 22 |
) |
| 23 |
// And the link element should be at least as big as the image they contain. |
| 24 |
call-function: ("check-link-and-img-size", {"selector": "a[href='link']:nth-child(1)"}) |
| 25 |
call-function: ("check-link-and-img-size", {"selector": "a[href='link']:nth-child(2)"}) |