Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 1bab87f

Browse files
author
Michelle Tilley
committed
Update and fix specs for pending state
1 parent 75cf40c commit 1bab87f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

spec/tree-view-spec.coffee

+7-7
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ describe "TreeView", ->
526526
sampleJs.mousedown()
527527
expect(sampleJs).toHaveClass 'selected'
528528

529-
if atom.workspace.buildTextEditor().isPending?
529+
if atom.workspace.getActivePane().getPendingItem?
530530
describe "when files are clicked", ->
531531
beforeEach ->
532532
jasmine.attachToDOM(workspaceElement)
@@ -548,7 +548,7 @@ describe "TreeView", ->
548548

549549
it "opens it in the pane in pending state", ->
550550
expect(activePaneItem.getPath()).toBe atom.project.getDirectories()[0].resolve('tree-view.js')
551-
expect(activePaneItem.isPending()).toBe true
551+
expect(atom.workspace.getActivePane().getPendingItem()).toEqual activePaneItem
552552

553553
it "changes the focus to the file", ->
554554
expect(atom.views.getView(activePaneItem)).toHaveFocus()
@@ -584,18 +584,18 @@ describe "TreeView", ->
584584

585585
it "opens it in pending state on first click", ->
586586
expect(activePaneItem.getPath()).toBe atom.project.getDirectories()[0].resolve('tree-view.js')
587-
expect(activePaneItem.isPending()).toBe true
587+
expect(atom.workspace.getActivePane().getPendingItem()).toEqual activePaneItem
588588

589589
it "terminates pending state on second click", ->
590590
sampleJs.trigger clickEvent(originalEvent: {detail: 2})
591591
waitsFor ->
592-
activePaneItem.isPending() is false
592+
atom.workspace.getActivePane().getPendingItem() isnt activePaneItem
593593

594594
it "does not create pending state on subsequent single click", ->
595595
sampleJs.trigger clickEvent(originalEvent: {detail: 2})
596596
sampleJs.trigger clickEvent(originalEvent: {detail: 1})
597597
waitsFor ->
598-
activePaneItem.isPending() is false
598+
atom.workspace.getActivePane().getPendingItem() isnt activePaneItem
599599

600600
describe "when a file is single-clicked, then double-clicked", ->
601601
activePaneItem = null
@@ -611,13 +611,13 @@ describe "TreeView", ->
611611

612612
it "opens it in pending state on single-click", ->
613613
expect(activePaneItem.getPath()).toBe atom.project.getDirectories()[0].resolve('tree-view.js')
614-
expect(activePaneItem.isPending()).toBe true
614+
expect(atom.workspace.getActivePane().getPendingItem()).toEqual activePaneItem
615615

616616
it "terminates pending state on the double-click and focuses file", ->
617617
sampleJs.trigger clickEvent(originalEvent: {detail: 2})
618618
expect(atom.views.getView(activePaneItem)).toHaveFocus()
619619
waitsFor ->
620-
activePaneItem.isPending() is false
620+
atom.workspace.getActivePane().getPendingItem() isnt activePaneItem
621621

622622
it "keeps focus on tree-view if the file is the active pane item", ->
623623
sampleJs.trigger clickEvent(originalEvent: {detail: 1})

0 commit comments

Comments
 (0)