Skip to content

Commit

Permalink
URL: ensure deleting all params keeps ? in URL
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyGu authored and annevk committed Jul 7, 2017
1 parent 411a72d commit 3239799
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions url/urlsearchparams-delete.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@
params.delete('first');
assert_false(params.has('first'), 'Search params object has no "first" name');
}, 'Deleting appended multiple');

test(function() {
var url = new URL('http://example.com/?param1&param2');
url.searchParams.delete('param1');
url.searchParams.delete('param2');
assert_equals(url.href, 'http://example.com/?', 'url.href has ?');
assert_equals(url.search, '', 'url.search does not have ?');
}, 'Deleting all params keeps ? in URL');
</script>
</head>
</html>

0 comments on commit 3239799

Please sign in to comment.