Skip to content
Browse files

Merge pull request #129 from taion/MenuItem

Add MenuItem to tests
  • Loading branch information...
2 parents e03139e + 99671b4 commit dfe8c4487c8a40b6165d3750ee5e512fa1be221f @AlexKVal AlexKVal committed
View
1 tests/IndexLinkContainer.spec.js
@@ -11,6 +11,7 @@ describe('IndexLinkContainer', () => {
[
'Button',
'NavItem',
+ 'MenuItem',
'ListGroupItem'
].forEach(name => {
describe(name, () => {
View
1 tests/LinkContainer.spec.js
@@ -11,6 +11,7 @@ describe('LinkContainer', () => {
[
'Button',
'NavItem',
+ 'MenuItem',
'ListGroupItem'
].forEach(name => {
describe(name, () => {
View
1 tests/visual/Home.js
@@ -7,6 +7,7 @@ export default () => (
<ul>
<li><Link to="/button">Button</Link></li>
<li><Link to="/nav-item">NavItem</Link></li>
+ <li><Link to="/menu-item">MenuItem</Link></li>
<li><Link to="/list-group-item">ListGroupItem</Link></li>
</ul>
</div>
View
44 tests/visual/MenuItemVisual.js
@@ -0,0 +1,44 @@
+import React from 'react';
+import ButtonToolbar from 'react-bootstrap/lib/ButtonToolbar';
+import MenuItem from 'react-bootstrap/lib/MenuItem';
+import SplitButton from 'react-bootstrap/lib/SplitButton';
+import {Link} from 'react-router';
+
+import LinkContainer from '../../src/LinkContainer';
+
+export default () => (
+ <div>
+ <Link to="/home">Back to Index</Link>
+ <h2>MenuItem</h2>
+
+ <h3>Baseline</h3>
+ <ButtonToolbar>
+ <SplitButton title="Dropdown">
+ <MenuItem eventKey="1">Action</MenuItem>
+ <MenuItem eventKey="2" active>Active action</MenuItem>
+ <MenuItem eventKey="3">Another action</MenuItem>
+ <MenuItem divider />
+ <MenuItem eventKey="4">Separated link</MenuItem>
+ </SplitButton>
+ </ButtonToolbar>
+
+ <h3>LinkContainer</h3>
+ <ButtonToolbar>
+ <SplitButton title="Dropdown">
+ <LinkContainer to="/home">
+ <MenuItem>Action</MenuItem>
+ </LinkContainer>
+ <LinkContainer to="/menu-item">
+ <MenuItem>Active action</MenuItem>
+ </LinkContainer>
+ <LinkContainer to="/home">
+ <MenuItem>Another action</MenuItem>
+ </LinkContainer>
+ <MenuItem divider />
+ <LinkContainer to="/home">
+ <MenuItem>Separated link</MenuItem>
+ </LinkContainer>
+ </SplitButton>
+ </ButtonToolbar>
+ </div>
+);
View
2 tests/visual/index.js
@@ -6,6 +6,7 @@ import {IndexRoute, Route, Router} from 'react-router';
import ButtonVisual from './ButtonVisual';
import Home from './Home';
import ListGroupItemVisual from './ListGroupItemVisual';
+import MenuItemVisual from './MenuItemVisual';
import NavItemVisual from './NavItemVisual';
import 'bootstrap/less/bootstrap.less';
@@ -28,6 +29,7 @@ ReactDOM.render(
<Route path="button" component={ButtonVisual} />
<Route path="nav-item" component={NavItemVisual} />
+ <Route path="menu-item" component={MenuItemVisual} />
<Route path="list-group-item" component={ListGroupItemVisual} />
</Route>
</Router>,

0 comments on commit dfe8c44

Please sign in to comment.
Something went wrong with that request. Please try again.