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

Commit

Permalink
Attach elements to jasmine DOM
Browse files Browse the repository at this point in the history
Atom migrated to using customElements from document.registerElement. Due
to this move, now there is need to attach some elements to the DOM on
some specs.
  • Loading branch information
sadick254 committed Aug 12, 2021
1 parent 3ea9d1f commit 90123d2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/tree-view-package-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2688,6 +2688,8 @@ describe "TreeView", ->
dotFileView.dispatchEvent(new MouseEvent('click', {bubbles: true, detail: 1}))

runs ->
workspaceElement = atom.views.getView(atom.workspace)
jasmine.attachToDOM(workspaceElement)
atom.commands.dispatch(treeView.element, "tree-view:duplicate")
copyDialog = atom.workspace.getModalPanels()[0].getItem()

Expand All @@ -2710,6 +2712,8 @@ describe "TreeView", ->
dotFileView.dispatchEvent(new MouseEvent('click', {bubbles: true, detail: 1}))

runs ->
workspaceElement = atom.views.getView(atom.workspace)
jasmine.attachToDOM(workspaceElement)
atom.commands.dispatch(treeView.element, "tree-view:duplicate")
copyDialog = atom.workspace.getModalPanels()[0].getItem()

Expand All @@ -2732,6 +2736,8 @@ describe "TreeView", ->
atom.workspace.open('tree-view.js')

runs ->
workspaceElement = atom.views.getView(atom.workspace)
jasmine.attachToDOM(workspaceElement)
editorElement = atom.views.getView(atom.workspace.getCenter().getActivePaneItem())
atom.commands.dispatch(editorElement, "tree-view:duplicate")
copyDialog = atom.workspace.getModalPanels()[0].getItem()
Expand Down Expand Up @@ -5244,6 +5250,7 @@ describe 'Icon class handling', ->
waitForPackageActivation()

runs ->
jasmine.attachToDOM(workspaceElement)
treeView = atom.packages.getActivePackage("tree-view").mainModule.getTreeViewInstance()
files = workspaceElement.querySelectorAll('li[is="tree-view-file"]')

Expand Down

0 comments on commit 90123d2

Please sign in to comment.