Skip to content

Commit afe28b0

Browse files
committed
Added test case from PR STRML#47.
1 parent 236ec57 commit afe28b0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/server.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,19 @@ describe('react-router-component (on server)', function() {
9090
handler: function(props) {
9191
return Router.Link({global: true, href: '/hi'});
9292
}
93+
}),
94+
Router.Location({
95+
path: '/hello3/*',
96+
handler: function(props) {
97+
return Router.Locations({className: 'Y', contextual: true},
98+
Router.Location({
99+
path: '/:subslug',
100+
handler: function(props) {
101+
return Router.Link({href: '/sup-' + props.subslug});
102+
}
103+
})
104+
);
105+
}
93106
})
94107
)
95108
}
@@ -121,6 +134,14 @@ describe('react-router-component (on server)', function() {
121134
assert(markup.match(/href="\/hi"/));
122135
});
123136

137+
it ('renders Link component with href scoped to its nested context prefix', function() {
138+
var markup = React.renderComponentToString(App({path: '/x/nice/hello3/welcome'}));
139+
assert(markup.match(/class="App"/));
140+
assert(markup.match(/class="X"/));
141+
assert(markup.match(/class="Y"/));
142+
assert(markup.match(/href="\/x\/nice\/hello3\/sup-welcome"/));
143+
});
144+
124145
});
125146

126147

0 commit comments

Comments
 (0)