mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 14:43:28 +00:00
fix link element test
Changes are made regarding to `host`, `port` and `hostname`. Definitions are provided by MDN.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user