mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
e198c4f6c4
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
21 lines
668 B
CoffeeScript
21 lines
668 B
CoffeeScript
# Utils for testing.
|
|
CSON = require 'season'
|
|
KeymapManager = require 'atom-keymap'
|
|
|
|
NylasTestUtils =
|
|
loadKeymap: (keymapPath) ->
|
|
{resourcePath} = atom.getLoadSettings()
|
|
basePath = CSON.resolve("#{resourcePath}/keymaps/base")
|
|
baseKeymaps = CSON.readFileSync(basePath)
|
|
atom.keymaps.add(basePath, baseKeymaps)
|
|
|
|
if keymapPath?
|
|
keymapPath = CSON.resolve("#{resourcePath}/#{keymapPath}")
|
|
keymapFile = CSON.readFileSync(keymapPath)
|
|
atom.keymaps.add(keymapPath, keymapFile)
|
|
|
|
keyPress: (key, target) ->
|
|
event = KeymapManager.buildKeydownEvent(key, target: target)
|
|
document.dispatchEvent(event)
|
|
|
|
module.exports = NylasTestUtils
|