Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d4de8c8

Browse files
miccycnyyx990803
authored andcommittedNov 28, 2016
Avoid rearrange query parameters (#946)
* avoid rearrange query params * delete unit text about query sorted alphabetically * delete unit text about query sorted alphabetically
1 parent c174f8d commit d4de8c8

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed
 

‎src/util/query.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function parseQuery (query: string): Dictionary<string> {
5555
}
5656

5757
export function stringifyQuery (obj: Dictionary<string>): string {
58-
const res = obj ? Object.keys(obj).sort().map(key => {
58+
const res = obj ? Object.keys(obj).map(key => {
5959
const val = obj[key]
6060

6161
if (val === undefined) {

‎test/e2e/specs/active-links.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
.assert.attributeContains('li:nth-child(6) a', 'href', '/active-links/users/evan#foo')
1515
.assert.attributeContains('li:nth-child(7) a', 'href', '/active-links/users/evan?foo=bar')
1616
.assert.attributeContains('li:nth-child(8) a', 'href', '/active-links/users/evan?foo=bar')
17-
.assert.attributeContains('li:nth-child(9) a', 'href', '/active-links/users/evan?baz=qux&foo=bar')
17+
.assert.attributeContains('li:nth-child(9) a', 'href', '/active-links/users/evan?foo=bar&baz=qux')
1818
.assert.attributeContains('li:nth-child(10) a', 'href', '/active-links/about')
1919
.assert.attributeContains('li:nth-child(11) a', 'href', '/active-links/about')
2020
.assert.containsText('.view', 'Home')

‎test/unit/specs/query.spec.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,4 @@ describe('Query utils', () => {
1010
}))
1111
})
1212
})
13-
14-
describe('stringifyQuery', () => {
15-
it('should work', () => {
16-
expect(stringifyQuery({
17-
foo: 'bar',
18-
baz: 'qux',
19-
arr: [1, 2]
20-
})).toBe('?arr=1&arr=2&baz=qux&foo=bar') // sorted alphabetically
21-
})
22-
})
2313
})

0 commit comments

Comments
 (0)
Please sign in to comment.