Mailspring/internal_packages/search-bar/spec/search-bar-spec.cjsx
Ben Gotow 92cf2d520c fix(asar): Support ASAR, and running of specs in prod builds
Summary:
fix(task-queue): Repair the findTask function

Add "ship logs" and "open logs" to the developer menu

Patches for Chromium 42

Test Plan: Run tests!

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1547
2015-05-21 14:41:30 -07:00

27 lines
930 B
CoffeeScript

React = require 'react'
ReactTestUtils = React.addons.TestUtils
{Actions} = require 'nylas-exports'
SearchBar = require '../lib/search-bar'
SearchSuggestionStore = require '../lib/search-suggestion-store'
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