Skip to content

Commit 4125b2e

Browse files
committed
[kyo-ui] use non-resolving a.test in iframe/img attribute tests
Problem: IframeTest "iframe src attribute" and HtmlRendererTest "ImgSrc.Absolute renders full URL" embed a real resolvable external domain (example.com) as a loaded subresource. withUI navigates via Browser.goto with the default Settle.NetworkIdle barrier, which does not return until the page load event fires, and the load event waits for the iframe/img subresource. On a runner whose egress to example.com is blocked or slow, that subresource connection hangs, so the settle barrier times out with "settle timeout after NetworkIdle (load event also never fired)" and the leaf fails. This surfaced on windows-JS while the identical JS code passed on linux-JS. Solution: point both subresources at the RFC 6761 reserved a.test TLD, which never resolves, so the subresource fails DNS immediately, the load event fires, and the settle barrier returns fast. The sibling leaf "iframe reactive src updates" already uses a.test and passes on the same runner. The tests only assert the rendered src attribute string, so the domain is irrelevant to what they verify.
1 parent 645767c commit 4125b2e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

kyo-ui/shared/src/test/scala/kyo/HtmlRendererTest.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,12 +757,12 @@ class HtmlRendererTest extends UITest:
757757
}
758758

759759
"ImgSrc.Absolute renders full URL" in {
760-
withUI(UI.div(UI.img(ImgSrc.Absolute(HttpUrl.parse("https://example.com/logo.png").getOrThrow), "logo").id("i"))) {
760+
withUI(UI.div(UI.img(ImgSrc.Absolute(HttpUrl.parse("https://a.test/logo.png").getOrThrow), "logo").id("i"))) {
761761
Browser.assertAttributeSatisfies(
762762
Selector.id("i"),
763763
"src",
764764
"ignore"
765-
)(s => s.contains("example.com") && s.contains("logo.png")).unit
765+
)(s => s.contains("a.test") && s.contains("logo.png")).unit
766766
}
767767
}
768768

kyo-ui/shared/src/test/scala/kyo/IframeTest.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class IframeTest extends UITest:
1313
}
1414

1515
"iframe src attribute" in {
16-
withUI(UI.div(UI.iframe("https://example.com/page").id("f"))) {
17-
Browser.assertAttributeSatisfies(Selector.id("f"), "src", "ignore")(_.contains("example.com/page")).unit
16+
withUI(UI.div(UI.iframe("https://a.test/page").id("f"))) {
17+
Browser.assertAttributeSatisfies(Selector.id("f"), "src", "ignore")(_.contains("a.test/page")).unit
1818
}
1919
}
2020

0 commit comments

Comments
 (0)