Account for shadow dom when asserting active element

This commit is contained in:
Nathan Sobo
2014-10-16 12:42:42 -06:00
parent b2bc09c13d
commit 158bbef38f

View File

@@ -1538,7 +1538,8 @@ describe "TextEditorComponent", ->
it "transfers focus to the hidden input", ->
expect(document.activeElement).toBe document.body
componentNode.focus()
expect(document.activeElement).toBe inputNode
expect(document.activeElement).toBe wrapperNode
expect(wrapperNode.shadowRoot.activeElement).toBe inputNode
it "adds the 'is-focused' class to the editor when the hidden input is focused", ->
expect(document.activeElement).toBe document.body