mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 05:41:05 +08:00
d3dcf89e9f
Summary: This commit adds the ability to perform event search in the calendar window. To achieve this, SearchBar has been moved from the thread-search package to be a part of the nylas-component-kit, and reused by both thread-search and nylas-calendar When an event is selected from search results, the calendar view is moved to the selected event. Depends on D3396 to open the event popover. Test Plan: Manual Reviewers: halla, bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D3424
26 lines
959 B
CoffeeScript
26 lines
959 B
CoffeeScript
React = require 'react'
|
|
ReactDOM = require 'react-dom'
|
|
ReactTestUtils = require('react-addons-test-utils')
|
|
|
|
ThreadSearchBar = require('../lib/thread-search-bar').default
|
|
SearchActions = require('../lib/search-actions').default
|
|
|
|
describe 'ThreadSearchBar', ->
|
|
beforeEach ->
|
|
spyOn(NylasEnv, "isMainWindow").andReturn true
|
|
@searchBar = ReactTestUtils.renderIntoDocument(<ThreadSearchBar />)
|
|
@input = ReactDOM.findDOMNode(@searchBar).querySelector("input")
|
|
|
|
it 'supports search queries with a colon character', ->
|
|
spyOn(SearchActions, "queryChanged")
|
|
test = "::Hello: World::"
|
|
ReactTestUtils.Simulate.change @input, target: value: test
|
|
expect(SearchActions.queryChanged).toHaveBeenCalledWith(test)
|
|
|
|
it 'preserves capitalization on searches', ->
|
|
test = "HeLlO wOrLd"
|
|
ReactTestUtils.Simulate.change @input, target: value: test
|
|
waitsFor =>
|
|
@input.value.length > 0
|
|
runs =>
|
|
expect(@input.value).toBe(test)
|