Mailspring/spec-inbox/test_utils.coffee
Evan Morikawa 637d5928e6 fix(ui): upgrade packages, minor ui/ux fixes
Summary:
fix keymaps and add archive-and-previous

test for star thread

focus bcc and cc

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1174
2015-02-10 11:10:14 -08:00

19 lines
522 B
CoffeeScript

# Utils for testing.
CSON = require 'season'
KeymapManager = require 'atom-keymap'
InboxTestUtils =
loadKeymap: (keymapPath) ->
baseKeymaps = CSON.readFileSync("keymaps/base.cson")
atom.keymaps.add("keymaps/base.cson", baseKeymaps)
if keymapPath?
keymapFile = CSON.readFileSync(keymapPath)
atom.keymaps.add(keymapPath, keymapFile)
keyPress: (key, target) ->
event = KeymapManager.buildKeydownEvent(key, target: target)
document.dispatchEvent(event)
module.exports = InboxTestUtils