mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
✅ Add failing tests for #14442
This commit is contained in:
@@ -62,6 +62,74 @@ describe('Dock', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('activating the next pane', () => {
|
||||
describe('when the dock has more than one pane', () => {
|
||||
it('activates the next pane', () => {
|
||||
jasmine.attachToDOM(atom.workspace.getElement())
|
||||
const dock = atom.workspace.getLeftDock()
|
||||
const pane1 = dock.getPanes()[0]
|
||||
const pane2 = pane1.splitRight()
|
||||
const pane3 = pane2.splitRight()
|
||||
pane2.activate()
|
||||
expect(pane1.isActive()).toBe(false)
|
||||
expect(pane2.isActive()).toBe(true)
|
||||
expect(pane3.isActive()).toBe(false)
|
||||
|
||||
dock.activateNextPane()
|
||||
expect(pane1.isActive()).toBe(false)
|
||||
expect(pane2.isActive()).toBe(false)
|
||||
expect(pane3.isActive()).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('when the dock has only one pane', () => {
|
||||
it('leaves the current pane active', () => {
|
||||
jasmine.attachToDOM(atom.workspace.getElement())
|
||||
const dock = atom.workspace.getLeftDock()
|
||||
|
||||
expect(dock.getPanes().length).toBe(1)
|
||||
const pane = dock.getPanes()[0]
|
||||
expect(pane.isActive()).toBe(true)
|
||||
dock.activateNextPane()
|
||||
expect(pane.isActive()).toBe(true)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('activating the previous pane', () => {
|
||||
describe('when the dock has more than one pane', () => {
|
||||
it('activates the previous pane', () => {
|
||||
jasmine.attachToDOM(atom.workspace.getElement())
|
||||
const dock = atom.workspace.getLeftDock()
|
||||
const pane1 = dock.getPanes()[0]
|
||||
const pane2 = pane1.splitRight()
|
||||
const pane3 = pane2.splitRight()
|
||||
pane2.activate()
|
||||
expect(pane1.isActive()).toBe(false)
|
||||
expect(pane2.isActive()).toBe(true)
|
||||
expect(pane3.isActive()).toBe(false)
|
||||
|
||||
dock.activatePreviousPane()
|
||||
expect(pane1.isActive()).toBe(true)
|
||||
expect(pane2.isActive()).toBe(false)
|
||||
expect(pane3.isActive()).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('when the dock has only one pane', () => {
|
||||
it('leaves the current pane active', () => {
|
||||
jasmine.attachToDOM(atom.workspace.getElement())
|
||||
const dock = atom.workspace.getLeftDock()
|
||||
|
||||
expect(dock.getPanes().length).toBe(1)
|
||||
const pane = dock.getPanes()[0]
|
||||
expect(pane.isActive()).toBe(true)
|
||||
dock.activatePreviousPane()
|
||||
expect(pane.isActive()).toBe(true)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('when the dock resize handle is double-clicked', () => {
|
||||
describe('when the dock is open', () => {
|
||||
it('resizes a vertically-oriented dock to the current item\'s preferred width', async () => {
|
||||
|
||||
Reference in New Issue
Block a user