mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 04:25:31 +08:00
91edef9f7a
Conflicts: internal_packages/inbox-activity-bar/lib/activity-bar-long-poll-item.cjsx
27 lines
937 B
CoffeeScript
27 lines
937 B
CoffeeScript
React = require 'react'
|
|
ReactTestUtils = React.addons.TestUtils
|
|
|
|
{Actions} = require 'nylas-exports'
|
|
|
|
SearchBar = require '../lib/search-bar'
|
|
SearchSuggestionStore = require '../lib/search-suggestion-store.coffee'
|
|
|
|
describe 'SearchBar', ->
|
|
beforeEach ->
|
|
@searchBar = ReactTestUtils.renderIntoDocument(<SearchBar />)
|
|
input = ReactTestUtils.findRenderedDOMComponentWithTag(@searchBar, "input")
|
|
@input = React.findDOMNode(input)
|
|
|
|
it 'supports search queries with a colon character', ->
|
|
spyOn(Actions, "searchQueryChanged")
|
|
test = "::Hello: World::"
|
|
ReactTestUtils.Simulate.change @input, target: value: test
|
|
expect(Actions.searchQueryChanged).toHaveBeenCalledWith [all: test]
|
|
|
|
it 'preserves capitalization on seraches', ->
|
|
test = "HeLlO wOrLd"
|
|
ReactTestUtils.Simulate.change @input, target: value: test
|
|
waitsFor =>
|
|
@input.value.length > 0
|
|
runs =>
|
|
expect(@input.value).toBe test
|