Skip to content

Commit

Permalink
Skip jQuery.Event deprecation tests when Proxy is not supported (IE11)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonihmig committed May 26, 2018
1 parent e92ffc4 commit 63823dc
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
import { EMBER_IMPROVED_INSTRUMENTATION } from '@ember/canary-features';
import { jQueryDisabled, jQuery } from 'ember-views';
import { ENV } from 'ember-environment';
import { HAS_NATIVE_PROXY } from 'ember-utils';

let canDataTransfer = !!document.createEvent('HTMLEvents').dataTransfer;

Expand Down Expand Up @@ -358,7 +359,7 @@ if (jQueryDisabled) {
assert.ok(receivedEvent instanceof jQuery.Event, 'event is a jQuery.Event');
}

['@test accessing jQuery.Event#originalEvent is deprecated'](assert) {
[`@${HAS_NATIVE_PROXY ? 'test' : 'skip'} accessing jQuery.Event#originalEvent is deprecated`](assert) {
let receivedEvent;

this.registerComponent('x-foo', {
Expand Down Expand Up @@ -429,7 +430,7 @@ if (jQueryDisabled) {
});
}

['@test accessing jQuery.Event#__originalEvent does not trigger deprecations to support ember-jquery-legacy'](
[`@${HAS_NATIVE_PROXY ? 'test' : 'skip'} accessing jQuery.Event#__originalEvent does not trigger deprecations to support ember-jquery-legacy`](
assert
) {
let receivedEvent;
Expand All @@ -448,8 +449,8 @@ if (jQueryDisabled) {
this.runTask(() => this.$('#foo').click());
expectNoDeprecation(() => {
let { __originalEvent: originalEvent } = receivedEvent;
assert.ok(originalEvent, 'jQuery event has originalEvent property');
assert.equal(originalEvent.type, 'click', 'properties of originalEvent are available');
assert.ok(originalEvent, 'jQuery event has __originalEvent property');
assert.equal(originalEvent.type, 'click', 'properties of __originalEvent are available');
});
}
}
Expand Down

0 comments on commit 63823dc

Please sign in to comment.