]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
test: null values in queries
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 5 Feb 2020 11:44:30 +0000 (12:44 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 5 Feb 2020 13:08:29 +0000 (14:08 +0100)
__tests__/stringifyQuery.spec.ts

index a03341e6ce22f0158775019df60246dc34d0eca4..de221c37416c04b99ba3c8728f1b5dc564040e81 100644 (file)
@@ -13,6 +13,11 @@ describe('stringifyQuery', () => {
     expect(stringifyQuery({ e: null, b: null })).toEqual('e&b')
   })
 
+  it('stringifies null values in arrays', () => {
+    expect(stringifyQuery({ e: [null] })).toEqual('e')
+    expect(stringifyQuery({ e: [null, 'c'] })).toEqual('e&e=c')
+  })
+
   it('stringifies numbers', () => {
     expect(stringifyQuery({ e: 2 })).toEqual('e=2')
     expect(stringifyQuery({ e: [2, 'b'] })).toEqual('e=2&e=b')