File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import expect from 'expect';
3
3
import React , { render } from 'react/addons' ;
4
4
import Router from '../Router' ;
5
5
import MemoryHistory from '../MemoryHistory' ;
6
+ import HashHistory from '../HashHistory' ;
6
7
import Route from '../Route' ;
7
8
import Link from '../Link' ;
8
9
@@ -55,6 +56,23 @@ describe('A <Link>', function () {
55
56
} ) ;
56
57
} ) ;
57
58
59
+ it ( 'knows how to make its href with HashHistory' , function ( ) {
60
+ var LinkWrapper = React . createClass ( {
61
+ render ( ) {
62
+ return < Link to = "/hello/michael" query = { { the : 'query' } } > Link</ Link > ;
63
+ }
64
+ } ) ;
65
+
66
+ render ( (
67
+ < Router history = { new HashHistory ( ) } >
68
+ < Route path = "/" component = { LinkWrapper } />
69
+ </ Router >
70
+ ) , div , function ( ) {
71
+ var a = div . querySelector ( 'a' ) ;
72
+ expect ( a . getAttribute ( 'href' ) ) . toEqual ( '/#/hello/michael?the=query' ) ;
73
+ } ) ;
74
+ } ) ;
75
+
58
76
describe ( 'with params' , function ( ) {
59
77
var App = React . createClass ( {
60
78
render ( ) {
You can’t perform that action at this time.
0 commit comments