-
Notifications
You must be signed in to change notification settings - Fork 398
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(karma): remove unnecessary IE11-related code (#5054)
- Loading branch information
1 parent
5d1837b
commit 158f7e6
Showing
1 changed file
with
9 additions
and
22 deletions.
There are no files selected for viewing
31 changes: 9 additions & 22 deletions
31
packages/@lwc/integration-karma/test/events/focus-event-composed/index.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,12 @@ | ||
// IE11 doesn't support FocusEvent constructor | ||
// https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent#Browser_compatibility | ||
function isFocusEventConstructorSupported() { | ||
try { | ||
new FocusEvent(); | ||
return true; | ||
} catch (_error) { | ||
return false; | ||
} | ||
} | ||
|
||
describe.runIf(isFocusEventConstructorSupported())('FocusEvent constructor supported', () => { | ||
it('should set composed to false by default', () => { | ||
const focusEvent = new FocusEvent('focus'); | ||
expect(focusEvent.composed).toBe(false); | ||
}); | ||
it('should set composed to false by default', () => { | ||
const focusEvent = new FocusEvent('focus'); | ||
expect(focusEvent.composed).toBe(false); | ||
}); | ||
|
||
it('should set composed to the value specified in the option', () => { | ||
const composedEvt = new FocusEvent('focus', { composed: true }); | ||
expect(composedEvt.composed).toBe(true); | ||
it('should set composed to the value specified in the option', () => { | ||
const composedEvt = new FocusEvent('focus', { composed: true }); | ||
expect(composedEvt.composed).toBe(true); | ||
|
||
const nonComposedEvt = new FocusEvent('focus', { composed: false }); | ||
expect(nonComposedEvt.composed).toBe(false); | ||
}); | ||
const nonComposedEvt = new FocusEvent('focus', { composed: false }); | ||
expect(nonComposedEvt.composed).toBe(false); | ||
}); |