forked from react-toolbox/react-toolbox
-
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.
- Loading branch information
1 parent
5b76a7f
commit fccf6f5
Showing
13 changed files
with
97 additions
and
14 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
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
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,51 @@ | ||
'use strict'; | ||
|
||
var _expect = require('expect'); | ||
|
||
var _expect2 = _interopRequireDefault(_expect); | ||
|
||
var _react = require('react'); | ||
|
||
var _react2 = _interopRequireDefault(_react); | ||
|
||
var _reactDom = require('react-dom'); | ||
|
||
var _reactDom2 = _interopRequireDefault(_reactDom); | ||
|
||
var _reactAddonsTestUtils = require('react-addons-test-utils'); | ||
|
||
var _reactAddonsTestUtils2 = _interopRequireDefault(_reactAddonsTestUtils); | ||
|
||
var _Menu = require('../Menu'); | ||
|
||
var _Menu2 = _interopRequireDefault(_Menu); | ||
|
||
var _MenuItem = require('../MenuItem'); | ||
|
||
var _MenuItem2 = _interopRequireDefault(_MenuItem); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
describe('MenuItem', function () { | ||
describe('#onClick', function () { | ||
it('passes to listener the event', function () { | ||
var listenerCalled = false; | ||
var handleClick = function handleClick(event) { | ||
listenerCalled = true; | ||
(0, _expect2.default)(event).toExist(); | ||
(0, _expect2.default)(event.target).toExist(); | ||
}; | ||
|
||
var tree = _reactAddonsTestUtils2.default.renderIntoDocument(_react2.default.createElement( | ||
_Menu2.default, | ||
null, | ||
_react2.default.createElement(_MenuItem2.default, { key: '1', onClick: handleClick }) | ||
)); | ||
|
||
var menuItem = _reactAddonsTestUtils2.default.findRenderedComponentWithType(tree, _MenuItem.MenuItem); | ||
_reactAddonsTestUtils2.default.Simulate.click(_reactDom2.default.findDOMNode(menuItem)); | ||
|
||
(0, _expect2.default)(listenerCalled).toBe(true); | ||
}); | ||
}); | ||
}); |
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