mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 10:12:00 +08:00
fix(message-store): Additional spec for double-focus, fix Menu warning
This commit is contained in:
parent
f2418be462
commit
c59e2f2438
2 changed files with 17 additions and 4 deletions
|
@ -35,10 +35,18 @@ describe "MessageStore", ->
|
|||
|
||||
it "should retrieve the focused thread", ->
|
||||
@focus = testThread
|
||||
MessageStore._thread = null
|
||||
FocusedContentStore.trigger({impactsCollection: -> true})
|
||||
expect(DatabaseStore.findAll).toHaveBeenCalled()
|
||||
expect(DatabaseStore.findAll.mostRecentCall.args[0]).toBe(Message)
|
||||
|
||||
describe "when the thread is already focused", ->
|
||||
it "should do nothing", ->
|
||||
@focus = testThread
|
||||
MessageStore._thread = @focus
|
||||
FocusedContentStore.trigger({impactsCollection: -> true})
|
||||
expect(DatabaseStore.findAll).not.toHaveBeenCalled()
|
||||
|
||||
describe "when the thread is unread", ->
|
||||
beforeEach ->
|
||||
@focus = null
|
||||
|
|
|
@ -22,20 +22,25 @@ class MenuItem extends React.Component
|
|||
- `checked` (optional) Pass a {Boolean} to specify whether the item is checked.
|
||||
###
|
||||
@propTypes:
|
||||
divider: React.PropTypes.string
|
||||
divider: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.bool])
|
||||
key: React.PropTypes.string
|
||||
selected: React.PropTypes.bool
|
||||
checked: React.PropTypes.bool
|
||||
|
||||
render: =>
|
||||
if @props.divider?
|
||||
<div className="item divider">{@props.divider}</div>
|
||||
if @props.divider
|
||||
dividerLabel = if _.isString(@props.divider) then @props.divider else ''
|
||||
<div className="item divider">
|
||||
{dividerLabel}
|
||||
</div>
|
||||
else
|
||||
className = classNames
|
||||
"item": true
|
||||
"selected": @props.selected
|
||||
"checked": @props.checked
|
||||
<div className={className} key={@props.key} onMouseDown={@props.onMouseDown}>{@props.content}</div>
|
||||
<div className={className} key={@props.key} onMouseDown={@props.onMouseDown}>
|
||||
{@props.content}
|
||||
</div>
|
||||
|
||||
###
|
||||
Public: React component for a {Menu} item that displays a name and email address.
|
||||
|
|
Loading…
Reference in a new issue