forked from react-bootstrap/react-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request react-bootstrap#609 from AlexKVal/collapsibleProp
[changed] collapsable => collapsible property
- Loading branch information
Showing
11 changed files
with
160 additions
and
46 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
import CollapsibleNav from './CollapsibleNav'; | ||
import React from 'react'; | ||
import deprecationWarning from './utils/deprecationWarning'; | ||
import assign from './utils/Object.assign'; | ||
import {specCollapsibleNav} from './CollapsibleNav'; | ||
|
||
let CollapsableNav = CollapsibleNav; | ||
const specCollapsableNav = assign({}, specCollapsibleNav, { | ||
componentDidMount() { | ||
deprecationWarning( | ||
'CollapsableNav', | ||
'CollapsibleNav', | ||
'https://github.com/react-bootstrap/react-bootstrap/issues/425#issuecomment-97110963' | ||
); | ||
} | ||
}); | ||
|
||
CollapsableNav.__deprecated__ = true; | ||
const CollapsableNav = React.createClass(specCollapsableNav); | ||
|
||
export default CollapsableNav; |
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
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,13 @@ | ||
import React from 'react'; | ||
import deprecationWarning from './deprecationWarning'; | ||
|
||
export default function collapsable(props, propName, componentName) { | ||
if (props[propName] !== undefined) { | ||
deprecationWarning( | ||
`${propName} in ${componentName}`, | ||
'collapsible', | ||
'https://github.com/react-bootstrap/react-bootstrap/issues/425' | ||
); | ||
} | ||
return React.PropTypes.bool.call(null, props, propName, componentName); | ||
} |
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,90 @@ | ||
import React from 'react'; | ||
import ReactTestUtils from 'react/lib/ReactTestUtils'; | ||
import CollapsibleNav from '../src/CollapsibleNav'; | ||
import Nav from '../src/Nav'; | ||
import Panel from '../src/Panel'; | ||
import {shouldWarn} from './helpers'; | ||
|
||
describe('Deprecations for collapsable property in CollapsibleNav', function () { | ||
it('Should not warn about deprecation when collaps_i_ble property is used', function () { | ||
let Component = React.createClass({ | ||
render: function() { | ||
return ( | ||
<CollapsibleNav collapsible /> | ||
); | ||
} | ||
}); | ||
ReactTestUtils.renderIntoDocument(<Component />); | ||
|
||
console.warn.called.should.be.false; | ||
}); | ||
|
||
it('Should warn about deprecation when collaps_a_ble property is used', function () { | ||
let Component = React.createClass({ | ||
render: function() { | ||
return ( | ||
<CollapsibleNav collapsable /> | ||
); | ||
} | ||
}); | ||
ReactTestUtils.renderIntoDocument(<Component />); | ||
|
||
shouldWarn('deprecated'); | ||
}); | ||
}); | ||
|
||
describe('Deprecations for collapsable property in Panel', function () { | ||
it('Should not warn about deprecation when collaps_i_ble property is used', function () { | ||
let Component = React.createClass({ | ||
render: function() { | ||
return ( | ||
<Panel collapsible /> | ||
); | ||
} | ||
}); | ||
ReactTestUtils.renderIntoDocument(<Component />); | ||
|
||
console.warn.called.should.be.false; | ||
}); | ||
|
||
it('Should warn about deprecation when collaps_a_ble property is used', function () { | ||
let Component = React.createClass({ | ||
render: function() { | ||
return ( | ||
<Panel collapsable /> | ||
); | ||
} | ||
}); | ||
ReactTestUtils.renderIntoDocument(<Component />); | ||
|
||
shouldWarn('deprecated'); | ||
}); | ||
}); | ||
|
||
describe('Deprecations for collapsable property in Nav', function () { | ||
it('Should not warn about deprecation when collaps_i_ble property is used', function () { | ||
let Component = React.createClass({ | ||
render: function() { | ||
return ( | ||
<Nav collapsible /> | ||
); | ||
} | ||
}); | ||
ReactTestUtils.renderIntoDocument(<Component />); | ||
|
||
console.warn.called.should.be.false; | ||
}); | ||
|
||
it('Should warn about deprecation when collaps_a_ble property is used', function () { | ||
let Component = React.createClass({ | ||
render: function() { | ||
return ( | ||
<Nav collapsable /> | ||
); | ||
} | ||
}); | ||
ReactTestUtils.renderIntoDocument(<Component />); | ||
|
||
shouldWarn('deprecated'); | ||
}); | ||
}); |
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
Oops, something went wrong.