From fa00a5da529a2cecb9dfbc42ea3b6887c7fd0ba5 Mon Sep 17 00:00:00 2001 From: Halil Durak Date: Mon, 20 Oct 2025 12:43:36 +0300 Subject: [PATCH] fix link element test Changes are made regarding to `host`, `port` and `hostname`. Definitions are provided by MDN. --- src/tests/html/link.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/tests/html/link.html b/src/tests/html/link.html index 0f1d869b..0433a0cd 100644 --- a/src/tests/html/link.html +++ b/src/tests/html/link.html @@ -16,8 +16,10 @@ testing.expectEqual('https://lightpanda.io', link.origin); link.host = 'lightpanda.io:443'; - testing.expectEqual('lightpanda.io:443', link.host); - testing.expectEqual('443', link.port); + // Port is omitted if its the default one for the scheme. + testing.expectEqual('lightpanda.io', link.host); + // Port is omitted if its the default one for the scheme. + testing.expectEqual('', link.port); testing.expectEqual('lightpanda.io', link.hostname); link.host = 'lightpanda.io'; @@ -42,9 +44,10 @@ testing.expectEqual('', link.port); link.port = '443'; - testing.expectEqual('foo.bar:443', link.host); + // Port is omitted if its the default one for the scheme. + testing.expectEqual('foo.bar', link.host); testing.expectEqual('foo.bar', link.hostname); - testing.expectEqual('https://foo.bar:443/?q=bar#frag', link.href); + testing.expectEqual('https://foo.bar/?q=bar#frag', link.href); link.port = null; testing.expectEqual('https://foo.bar/?q=bar#frag', link.href);