Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Decode and encode URLs * Tests for encode/decode
- Loading branch information
Showing
8 changed files
with
147 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import expect from 'expect' | ||
import execSteps from './execSteps' | ||
|
||
export default (history, done) => { | ||
const steps = [ | ||
(location) => { | ||
expect(location).toMatch({ | ||
pathname: '/' | ||
}) | ||
|
||
const pathname = '/%E6%AD%B4%E5%8F%B2' | ||
const search = '?%E3%82%AD%E3%83%BC=%E5%80%A4' | ||
const hash = '#%E3%83%8F%E3%83%83%E3%82%B7%E3%83%A5' | ||
history.push(pathname + search + hash) | ||
}, | ||
(location, action) => { | ||
expect(action).toBe('PUSH') | ||
expect(location).toMatch({ | ||
pathname: '/歴史', | ||
search: '?キー=値', | ||
hash: '#ハッシュ' | ||
}) | ||
} | ||
] | ||
|
||
execSteps(steps, history, done) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import expect from 'expect' | ||
import execSteps from './execSteps' | ||
|
||
export default (history, done) => { | ||
const steps = [ | ||
(location) => { | ||
expect(location).toMatch({ | ||
pathname: '/' | ||
}) | ||
|
||
const pathname = '/歴史' | ||
const search = '?キー=値' | ||
const hash = '#ハッシュ' | ||
history.push(pathname + search + hash) | ||
}, | ||
(location, action) => { | ||
expect(action).toBe('PUSH') | ||
expect(location).toMatch({ | ||
pathname: '/歴史', | ||
search: '?キー=値', | ||
hash: '#ハッシュ' | ||
}) | ||
} | ||
] | ||
|
||
execSteps(steps, history, done) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters