From ed111566065a41ad144b6119a5d4ea16869560b6 Mon Sep 17 00:00:00 2001 From: weiyuanyue Date: Tue, 22 Nov 2016 23:58:29 +0800 Subject: [PATCH 1/3] avoid rearrange query params --- src/util/query.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/query.js b/src/util/query.js index 34e755cef..14408cc73 100644 --- a/src/util/query.js +++ b/src/util/query.js @@ -55,7 +55,7 @@ function parseQuery (query: string): Dictionary { } export function stringifyQuery (obj: Dictionary): string { - const res = obj ? Object.keys(obj).sort().map(key => { + const res = obj ? Object.keys(obj).map(key => { const val = obj[key] if (val === undefined) { From 43663ed9fd3276a32f5596c33181a8344cc1d87c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A6=E5=85=83=E6=82=A6?= Date: Mon, 28 Nov 2016 19:28:32 +0800 Subject: [PATCH 2/3] delete unit text about query sorted alphabetically --- test/unit/specs/query.spec.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/test/unit/specs/query.spec.js b/test/unit/specs/query.spec.js index 5b640558c..62c809f59 100644 --- a/test/unit/specs/query.spec.js +++ b/test/unit/specs/query.spec.js @@ -10,14 +10,4 @@ describe('Query utils', () => { })) }) }) - - describe('stringifyQuery', () => { - it('should work', () => { - expect(stringifyQuery({ - foo: 'bar', - baz: 'qux', - arr: [1, 2] - })).toBe('?arr=1&arr=2&baz=qux&foo=bar') // sorted alphabetically - }) - }) }) From 5d3c7f6e18cdd8732ebe6fbad0c49183c6edc00d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A6=E5=85=83=E6=82=A6?= Date: Mon, 28 Nov 2016 19:54:09 +0800 Subject: [PATCH 3/3] delete unit text about query sorted alphabetically --- test/e2e/specs/active-links.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/specs/active-links.js b/test/e2e/specs/active-links.js index 781fb468e..db45d1ab7 100644 --- a/test/e2e/specs/active-links.js +++ b/test/e2e/specs/active-links.js @@ -14,7 +14,7 @@ module.exports = { .assert.attributeContains('li:nth-child(6) a', 'href', '/active-links/users/evan#foo') .assert.attributeContains('li:nth-child(7) a', 'href', '/active-links/users/evan?foo=bar') .assert.attributeContains('li:nth-child(8) a', 'href', '/active-links/users/evan?foo=bar') - .assert.attributeContains('li:nth-child(9) a', 'href', '/active-links/users/evan?baz=qux&foo=bar') + .assert.attributeContains('li:nth-child(9) a', 'href', '/active-links/users/evan?foo=bar&baz=qux') .assert.attributeContains('li:nth-child(10) a', 'href', '/active-links/about') .assert.attributeContains('li:nth-child(11) a', 'href', '/active-links/about') .assert.containsText('.view', 'Home')