Skip to content

Commit fa00a5d

Browse files
committed
fix link element test
Changes are made regarding to `host`, `port` and `hostname`. Definitions are provided by MDN.
1 parent 344420f commit fa00a5d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/tests/html/link.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
testing.expectEqual('https://lightpanda.io', link.origin);
1717

1818
link.host = 'lightpanda.io:443';
19-
testing.expectEqual('lightpanda.io:443', link.host);
20-
testing.expectEqual('443', link.port);
19+
// Port is omitted if its the default one for the scheme.
20+
testing.expectEqual('lightpanda.io', link.host);
21+
// Port is omitted if its the default one for the scheme.
22+
testing.expectEqual('', link.port);
2123
testing.expectEqual('lightpanda.io', link.hostname);
2224

2325
link.host = 'lightpanda.io';
@@ -42,9 +44,10 @@
4244

4345
testing.expectEqual('', link.port);
4446
link.port = '443';
45-
testing.expectEqual('foo.bar:443', link.host);
47+
// Port is omitted if its the default one for the scheme.
48+
testing.expectEqual('foo.bar', link.host);
4649
testing.expectEqual('foo.bar', link.hostname);
47-
testing.expectEqual('https://foo.bar:443/?q=bar#frag', link.href);
50+
testing.expectEqual('https://foo.bar/?q=bar#frag', link.href);
4851
link.port = null;
4952
testing.expectEqual('https://foo.bar/?q=bar#frag', link.href);
5053

0 commit comments

Comments
 (0)