mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 21:57:55 +08:00
92cf2d520c
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
|