summaryrefslogtreecommitdiff
path: root/history/modules/__tests__/TestSequences/PushEncodedLocation.js
blob: f71d671092488b02187510f04820342076f282f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import expect from 'expect';

import execSteps from './execSteps.js';

export default function(history, done) {
  const steps = [
    location => {
      expect(location).toMatchObject({
        pathname: '/'
      });

      const pathname = '/歴史';
      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).toMatchObject({
        pathname: '/歴史',
        search: '?%E3%82%AD%E3%83%BC=%E5%80%A4',
        hash: '#%E3%83%8F%E3%83%83%E3%82%B7%E3%83%A5'
      });
    }
  ];

  execSteps(steps, history, done);
}