File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -61,3 +61,12 @@ test(() => {
61
61
assert_equals ( url . pathname , 'space ' ) ;
62
62
assert_equals ( url . href , 'data:space #test' ) ;
63
63
} , 'Changing the query of a URL with an opaque path can impact the path if the URL has no fragment' ) ;
64
+
65
+ test ( ( ) => {
66
+ const params = new URLSearchParams ( ) ;
67
+ params . append ( 'a' , 'b' ) ;
68
+ params . append ( 'a' , 'c' ) ;
69
+ params . append ( 'a' , 'd' ) ;
70
+ params . delete ( 'a' , 'c' ) ;
71
+ assert_equals ( params . toString ( ) , 'a=b&a=d' ) ;
72
+ } , "Two-argument delete()" ) ;
Original file line number Diff line number Diff line change @@ -22,3 +22,16 @@ test(function() {
22
22
params . delete ( 'first' ) ;
23
23
assert_false ( params . has ( 'first' ) , 'Search params object has no name "first"' ) ;
24
24
} , 'has() following delete()' ) ;
25
+
26
+ test ( ( ) => {
27
+ const params = new URLSearchParams ( "a=b&a=d&c&e&" ) ;
28
+ assert_true ( params . has ( 'a' , 'b' ) ) ;
29
+ assert_false ( params . has ( 'a' , 'c' ) ) ;
30
+ assert_true ( params . has ( 'a' , 'd' ) ) ;
31
+ assert_true ( params . has ( 'e' , '' ) ) ;
32
+ params . append ( 'first' , null ) ;
33
+ assert_false ( params . has ( 'first' , '' ) ) ;
34
+ assert_true ( params . has ( 'first' , 'null' ) ) ;
35
+ params . delete ( 'a' , 'b' ) ;
36
+ assert_true ( params . has ( 'a' , 'd' ) ) ;
37
+ } , "Two-argument has()" ) ;
You can’t perform that action at this time.
0 commit comments