Test for proxy links with class image

This commit is contained in:
Cadence Ember 2022-10-13 22:53:05 +13:00
parent 2e6fa6088b
commit 9c05e95f07
Signed by: cadence
GPG key ID: BC1C2C61CF521B17

View file

@ -52,7 +52,7 @@
(a (@ (data-test-wikilink) (href "https://test.fandom.com/wiki/Another_Page") (title "Another Page")) (a (@ (data-test-wikilink) (href "https://test.fandom.com/wiki/Another_Page") (title "Another Page"))
"Another Page")))) "Another Page"))))
(figure (@ (class "thumb tnone")) (figure (@ (class "thumb tnone"))
(a (@ (href "https://static.wikia.nocookie.net/nice-image.png") (class "image")) (a (@ (href "https://static.wikia.nocookie.net/nice-image.png") (class "image") (data-test-figure-a))
(img (@ (src "data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAQAICTAEAOw%3D%3D") (img (@ (src "data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAQAICTAEAOw%3D%3D")
(data-src "https://static.wikia.nocookie.net/nice-image-thumbnail.png") (data-src "https://static.wikia.nocookie.net/nice-image-thumbnail.png")
(class "thumbimage lazyload")))) (class "thumbimage lazyload"))))
@ -255,6 +255,11 @@
(λ (t a c) (and (eq? t 'a) (has-class? "image-thumbnail" a))) (λ (t a c) (and (eq? t 'a) (has-class? "image-thumbnail" a)))
transformed)))) transformed))))
"/proxy?dest=https%3A%2F%2Fstatic.wikia.nocookie.net%2Fnice-image.png") "/proxy?dest=https%3A%2F%2Fstatic.wikia.nocookie.net%2Fnice-image.png")
(check-equal? (get-attribute 'href (bits->attributes
((query-selector
(λ (t a c) (member '(data-test-figure-a) a))
transformed))))
"/proxy?dest=https%3A%2F%2Fstatic.wikia.nocookie.net%2Fnice-image.png")
; check that noscript images are removed ; check that noscript images are removed
(check-equal? ((query-selector (λ (t a c) (eq? t 'noscript)) transformed)) #f)) (check-equal? ((query-selector (λ (t a c) (eq? t 'noscript)) transformed)) #f))