mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Add top/bottom bar specs
This commit is contained in:
@@ -72,6 +72,11 @@ describe "WorkspaceElement", ->
|
||||
expect(topContainer.nextSibling).toBe workspaceElement.paneContainer
|
||||
expect(bottomContainer.previousSibling).toBe workspaceElement.paneContainer
|
||||
|
||||
topBarContainer = workspaceElement.querySelector('atom-panel-container.top-bar')
|
||||
bottomBarContainer = workspaceElement.querySelector('atom-panel-container.bottom-bar')
|
||||
expect(topBarContainer.nextSibling).toBe workspaceElement.horizontalAxis
|
||||
expect(bottomBarContainer.previousSibling).toBe workspaceElement.horizontalAxis
|
||||
|
||||
modalContainer = workspaceElement.querySelector('atom-panel-container.modal')
|
||||
expect(modalContainer.parentNode).toBe workspaceElement
|
||||
|
||||
|
||||
@@ -894,6 +894,36 @@ describe "Workspace", ->
|
||||
expect(itemView instanceof TestItemElement).toBe(true)
|
||||
expect(itemView.getModel()).toBe(model)
|
||||
|
||||
describe '::addTopBarPanel(model)', ->
|
||||
it 'adds a panel to the correct panel container', ->
|
||||
expect(atom.workspace.getTopBarPanels().length).toBe(0)
|
||||
atom.workspace.panelContainers.topBar.onDidAddPanel addPanelSpy = jasmine.createSpy()
|
||||
|
||||
model = new TestItem
|
||||
panel = atom.workspace.addTopBarPanel(item: model)
|
||||
|
||||
expect(panel).toBeDefined()
|
||||
expect(addPanelSpy).toHaveBeenCalledWith({panel, index: 0})
|
||||
|
||||
itemView = atom.views.getView(atom.workspace.getTopBarPanels()[0].getItem())
|
||||
expect(itemView instanceof TestItemElement).toBe(true)
|
||||
expect(itemView.getModel()).toBe(model)
|
||||
|
||||
describe '::addBottomBarPanel(model)', ->
|
||||
it 'adds a panel to the correct panel container', ->
|
||||
expect(atom.workspace.getBottomBarPanels().length).toBe(0)
|
||||
atom.workspace.panelContainers.bottomBar.onDidAddPanel addPanelSpy = jasmine.createSpy()
|
||||
|
||||
model = new TestItem
|
||||
panel = atom.workspace.addBottomBarPanel(item: model)
|
||||
|
||||
expect(panel).toBeDefined()
|
||||
expect(addPanelSpy).toHaveBeenCalledWith({panel, index: 0})
|
||||
|
||||
itemView = atom.views.getView(atom.workspace.getBottomBarPanels()[0].getItem())
|
||||
expect(itemView instanceof TestItemElement).toBe(true)
|
||||
expect(itemView.getModel()).toBe(model)
|
||||
|
||||
describe '::addModalPanel(model)', ->
|
||||
it 'adds a panel to the correct panel container', ->
|
||||
expect(atom.workspace.getModalPanels().length).toBe(0)
|
||||
|
||||
Reference in New Issue
Block a user