fix command pallete specs to reflect new classes

This commit is contained in:
Justin Palmer
2013-02-04 11:34:27 -08:00
parent 4845135375
commit 09efd15122

View File

@@ -16,15 +16,15 @@ describe "CommandPalette", ->
afterEach ->
rootView.remove()
describe "when command-palette:toggle is triggered on the root view", ->
fdescribe "when command-palette:toggle is triggered on the root view", ->
it "shows a list of all valid command descriptions, names, and keybindings for the previously focused element", ->
keyBindings = _.losslessInvert(keymap.bindingsForElement(rootView.getActiveEditor()))
for eventName, description of rootView.getActiveEditor().events()
eventLi = palette.list.children("[data-event-name='#{eventName}']")
if description
expect(eventLi).toExist()
expect(eventLi.find('.event-name')).toHaveText(eventName)
expect(eventLi.find('.event-description')).toHaveText(description)
expect(eventLi.find('.label')).toHaveText(description)
expect(eventLi.find('.label').attr('title')).toBe(eventName)
for binding in keyBindings[eventName] ? []
expect(eventLi.find(".key-binding:contains(#{binding})")).toExist()
else
@@ -39,8 +39,8 @@ describe "CommandPalette", ->
description = editorEvents[eventName] unless description
if description
expect(eventLi).toExist()
expect(eventLi.find('.event-name')).toHaveText(eventName)
expect(eventLi.find('.event-description')).toHaveText(description)
expect(eventLi.find('.label')).toHaveText(description)
expect(eventLi.find('.label').attr('title')).toBe(eventName)
else
expect(eventLi).not.toExist()