mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Guard against unfocused window in beforeEach
This commit is contained in:
committed by
Antonio Scandurra
parent
401434858b
commit
b152bfd9c6
@@ -267,9 +267,11 @@ describe('TextEditorComponent', () => {
|
||||
})
|
||||
|
||||
describe('focus', () => {
|
||||
it('focuses the hidden input element and adds the is-focused class when focused', async () => {
|
||||
beforeEach(() => {
|
||||
assertDocumentFocused()
|
||||
})
|
||||
|
||||
it('focuses the hidden input element and adds the is-focused class when focused', async () => {
|
||||
const {component, element, editor} = buildComponent()
|
||||
const {hiddenInput} = component.refs
|
||||
|
||||
@@ -290,8 +292,6 @@ describe('TextEditorComponent', () => {
|
||||
})
|
||||
|
||||
it('updates the component when the hidden input is focused directly', async () => {
|
||||
assertDocumentFocused()
|
||||
|
||||
const {component, element, editor} = buildComponent()
|
||||
const {hiddenInput} = component.refs
|
||||
expect(element.classList.contains('is-focused')).toBe(false)
|
||||
@@ -303,8 +303,6 @@ describe('TextEditorComponent', () => {
|
||||
})
|
||||
|
||||
it('gracefully handles a focus event that occurs prior to the attachedCallback of the element', () => {
|
||||
assertDocumentFocused()
|
||||
|
||||
const {component, element, editor} = buildComponent({attach: false})
|
||||
const parent = document.createElement('text-editor-component-test-element')
|
||||
parent.appendChild(element)
|
||||
@@ -314,8 +312,6 @@ describe('TextEditorComponent', () => {
|
||||
})
|
||||
|
||||
it('gracefully handles a focus event that occurs prior to detecting the element has become visible', async () => {
|
||||
assertDocumentFocused()
|
||||
|
||||
const {component, element, editor} = buildComponent({attach: false})
|
||||
element.style.display = 'none'
|
||||
jasmine.attachToDOM(element)
|
||||
|
||||
Reference in New Issue
Block a user