File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,6 +59,9 @@ module.exports = function (grunt) {
5959 } ,
6060
6161 react : {
62+ options : {
63+ harmony : true
64+ } ,
6265 src : {
6366 files : [
6467 {
Original file line number Diff line number Diff line change @@ -22,19 +22,26 @@ var NavItem = React.createClass({
2222 } ,
2323
2424 render : function ( ) {
25- var classes = {
26- 'active' : this . props . active ,
27- 'disabled' : this . props . disabled
28- } ;
25+ var {
26+ disabled,
27+ active,
28+ href,
29+ title,
30+ children,
31+ ...props } = this . props ,
32+ classes = {
33+ 'active' : active ,
34+ 'disabled' : disabled
35+ } ;
2936
3037 return (
31- < li { ...this . props } className = { joinClasses ( this . props . className , classSet ( classes ) ) } >
38+ < li { ...props } className = { joinClasses ( props . className , classSet ( classes ) ) } >
3239 < a
33- href = { this . props . href }
34- title = { this . props . title }
40+ href = { href }
41+ title = { title }
3542 onClick = { this . handleClick }
3643 ref = "anchor" >
37- { this . props . children }
44+ { children }
3845 </ a >
3946 </ li >
4047 ) ;
Original file line number Diff line number Diff line change @@ -34,6 +34,17 @@ describe('NavItem', function () {
3434 assert . equal ( linkElement . title , 'content' ) ;
3535 } ) ;
3636
37+ it ( 'Should not add anchor properties to li' , function ( ) {
38+ var instance = ReactTestUtils . renderIntoDocument (
39+ < NavItem href = '/hi' title = 'boom!' >
40+ Item content
41+ </ NavItem >
42+ ) ;
43+
44+ assert . ok ( ! instance . getDOMNode ( ) . hasAttribute ( 'href' ) ) ;
45+ assert . ok ( ! instance . getDOMNode ( ) . hasAttribute ( 'title' ) ) ;
46+ } ) ;
47+
3748 it ( 'Should call `onSelect` when item is selected' , function ( done ) {
3849 function handleSelect ( key ) {
3950 assert . equal ( key , '2' ) ;
You can’t perform that action at this time.
0 commit comments