fix(specs): Fix remaining broken specs

This commit is contained in:
Juan Tejada 2016-10-27 11:44:19 -07:00
parent da48d8433e
commit 645a032a50
3 changed files with 4 additions and 7 deletions

View file

@ -34,19 +34,19 @@ describe('DatePickerPopover', function sendLaterPopover() {
});
describe('onSelectCustomOption', () => {
describe('onCustomDateSelected', () => {
it('selects date', () => {
const popover = makePopover()
const instance = popover.instance()
spyOn(instance, 'selectDate')
instance.onSelectCustomOption('date', 'abc')
instance.onCustomDateSelected('date', 'abc')
expect(instance.selectDate).toHaveBeenCalledWith('date', 'Custom')
});
it('throws error if date is invalid', () => {
spyOn(NylasEnv, 'showErrorDialog')
const popover = makePopover()
popover.instance().onSelectCustomOption(null, 'abc')
popover.instance().onCustomDateSelected(null, 'abc')
expect(NylasEnv.showErrorDialog).toHaveBeenCalled()
});
});

View file

@ -18,14 +18,12 @@ class MenuItem extends React.Component
###
Public: React `props` supported by MenuItem:
- `index`: {Number} of the index of the current menu item
- `divider` (optional) Pass a {Boolean} to render the menu item as a section divider.
- `key` (optional) Pass a {String} to be the React key to optimize rendering lists of items.
- `selected` (optional) Pass a {Boolean} to specify whether the item is selected.
- `checked` (optional) Pass a {Boolean} to specify whether the item is checked.
###
@propTypes:
index: React.PropTypes.number.isRequired
divider: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.bool])
selected: React.PropTypes.bool
checked: React.PropTypes.bool
@ -263,7 +261,6 @@ class Menu extends React.Component
seenItemKeys[key] = item
<MenuItem
index={i}
key={key}
onMouseDown={onMouseDown}
checked={@props.itemChecked?(item)}

@ -1 +1 @@
Subproject commit 41a8efe6bd47a3be188075b8aab9a3b567b8d31d
Subproject commit 36f341021c21403cbad6022ea08d81c4392a6a7a