From: Eduardo San Martin Morote Date: Wed, 5 Feb 2020 11:41:58 +0000 (+0100) Subject: test: test empty string values in queries X-Git-Tag: v4.0.0-alpha.0~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b8dc3e7698a8c7abfbe8ec652fa5df4045368699;p=thirdparty%2Fvuejs%2Frouter.git test: test empty string values in queries --- diff --git a/__tests__/parseQuery.spec.ts b/__tests__/parseQuery.spec.ts index bb1863b9..f42b92fa 100644 --- a/__tests__/parseQuery.spec.ts +++ b/__tests__/parseQuery.spec.ts @@ -9,6 +9,13 @@ describe('parseQuery', () => { }) }) + it('parses empty string values', () => { + expect(parseQuery('e=&c=a')).toEqual({ + e: '', + c: 'a', + }) + }) + it('decodes empty values as null', () => { expect(parseQuery('e&b&c=a')).toEqual({ e: null, @@ -17,7 +24,7 @@ describe('parseQuery', () => { }) }) - it('decodes empty values as null in arrays', () => { + it('parses empty values as null in arrays', () => { expect(parseQuery('e&e&e=a')).toEqual({ e: [null, null, 'a'], })