mirror of
https://github.com/atom/atom.git
synced 2026-01-15 01:48:15 -05:00
Fix remaining tests
This commit is contained in:
@@ -12,8 +12,8 @@ describe("HistoryManager", () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
commandDisposable = jasmine.createSpyObj('Disposable', ['dispose'])
|
||||
commandRegistry = jasmine.createSpyObj('CommandRegistry', ['add'])
|
||||
commandRegistry.add.andReturn(commandDisposable)
|
||||
commandRegistry = jasmine.createSpyObj('CommandRegistry', ['addBundled'])
|
||||
commandRegistry.addBundled.andReturn(commandDisposable)
|
||||
|
||||
stateStore = new StateStore('history-manager-test', 1)
|
||||
await stateStore.save('history-manager', {
|
||||
@@ -31,7 +31,7 @@ describe("HistoryManager", () => {
|
||||
})
|
||||
|
||||
historyManager = new HistoryManager({stateStore, project, commands: commandRegistry})
|
||||
historyManager.initialize({localStorage: window.localStorage})
|
||||
historyManager.initialize(window.localStorage)
|
||||
await historyManager.loadState()
|
||||
})
|
||||
|
||||
@@ -41,8 +41,8 @@ describe("HistoryManager", () => {
|
||||
|
||||
describe("constructor", () => {
|
||||
it("registers the 'clear-project-history' command function", () => {
|
||||
expect(commandRegistry.add).toHaveBeenCalled()
|
||||
const cmdCall = commandRegistry.add.calls[0]
|
||||
expect(commandRegistry.addBundled).toHaveBeenCalled()
|
||||
const cmdCall = commandRegistry.addBundled.calls[0]
|
||||
expect(cmdCall.args.length).toBe(2)
|
||||
expect(cmdCall.args[0]).toBe('atom-workspace')
|
||||
expect(typeof cmdCall.args[1]['application:clear-project-history']).toBe('function')
|
||||
|
||||
@@ -5,11 +5,8 @@ describe "MenuManager", ->
|
||||
menu = null
|
||||
|
||||
beforeEach ->
|
||||
menu = new MenuManager(
|
||||
resourcePath: atom.getLoadSettings().resourcePath
|
||||
keymapManager: atom.keymaps
|
||||
packageManager: atom.packages
|
||||
)
|
||||
menu = new MenuManager({keymapManager: atom.keymaps, packageManager: atom.packages})
|
||||
menu.initialize({resourcePath: atom.getLoadSettings().resourcePath})
|
||||
|
||||
describe "::add(items)", ->
|
||||
it "can add new menus that can be removed with the returned disposable", ->
|
||||
|
||||
@@ -5,6 +5,7 @@ describe "ViewRegistry", ->
|
||||
|
||||
beforeEach ->
|
||||
registry = new ViewRegistry
|
||||
registry.initialize()
|
||||
|
||||
afterEach ->
|
||||
registry.clearDocumentRequests()
|
||||
|
||||
@@ -15,7 +15,8 @@ describe "WindowEventHandler", ->
|
||||
loadSettings.initialPath = initialPath
|
||||
loadSettings
|
||||
atom.project.destroy()
|
||||
windowEventHandler = new WindowEventHandler({atomEnvironment: atom, applicationDelegate: atom.applicationDelegate, window, document})
|
||||
windowEventHandler = new WindowEventHandler({atomEnvironment: atom, applicationDelegate: atom.applicationDelegate})
|
||||
windowEventHandler.initialize(window, document)
|
||||
|
||||
afterEach ->
|
||||
windowEventHandler.unsubscribe()
|
||||
|
||||
@@ -792,8 +792,13 @@ class AtomEnvironment extends Model
|
||||
uninstallUncaughtErrorHandler: ->
|
||||
@window.onerror = @previousWindowErrorHandler
|
||||
|
||||
installWindowEventHandler: ->
|
||||
@windowEventHandler = new WindowEventHandler({atomEnvironment: this, @applicationDelegate})
|
||||
@windowEventHandler.initialize(@window, @document)
|
||||
|
||||
uninstallWindowEventHandler: ->
|
||||
@windowEventHandler?.unsubscribe()
|
||||
@windowEventHandler = null
|
||||
|
||||
###
|
||||
Section: Messaging the User
|
||||
|
||||
Reference in New Issue
Block a user