Add testing infrastructure using jest
Added simple test to illustrate how to use jest with react.
This commit is contained in:
parent
e2c13cd1db
commit
e53cbd0fc6
4 changed files with 58 additions and 15 deletions
|
|
@ -35,25 +35,13 @@ String.prototype.trunc = String.prototype.trunc || function(n){
|
|||
};
|
||||
|
||||
const {
|
||||
AppBar,
|
||||
AppCanvas,
|
||||
FontIcon,
|
||||
IconButton,
|
||||
EnhancedButton,
|
||||
NavigationClose,
|
||||
FloatingActionButton,
|
||||
Menu,
|
||||
MenuItem,
|
||||
Mixins,
|
||||
RaisedButton,
|
||||
FlatButton,
|
||||
Popover,
|
||||
Badge,
|
||||
TextField,
|
||||
Dialog,
|
||||
Styles,
|
||||
LeftNav,
|
||||
Paper} = mui
|
||||
Paper
|
||||
} = mui
|
||||
|
||||
const DefaultRawTheme = Styles.LightRawTheme
|
||||
|
||||
|
|
|
|||
17
app/components/__tests__/EntrySelector-test.jsx
Normal file
17
app/components/__tests__/EntrySelector-test.jsx
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
jest.autoMockOff()
|
||||
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import TestUtils from 'react-addons-test-utils'
|
||||
|
||||
const EntrySelector = require('../EntrySelector').default
|
||||
|
||||
describe('EntrySelector', () => {
|
||||
|
||||
it('test jest', () => {
|
||||
var entrySelector = TestUtils.renderIntoDocument(
|
||||
<EntrySelector id="entry-selector" className="left inline fill-height" />
|
||||
)
|
||||
expect(entrySelector.state.entries.length).toEqual(0)
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue