Skip to content

Commit

Permalink
edit the test as in the review
Browse files Browse the repository at this point in the history
  • Loading branch information
cherifGsoul committed Oct 22, 2018
1 parent 635f9cd commit 1181693
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions can-dom-events-test.js
Expand Up @@ -11,6 +11,8 @@ unit.test('domEvents.addEventListener works', function (assert) {
var input = document.createElement('input');
var eventType = 'click';
var event;
var qf = document.querySelector('#qunit-fixture');
qf.appendChild(input);

var handler = function () {
assert.ok(true, 'event handler should be called');
Expand All @@ -20,8 +22,6 @@ unit.test('domEvents.addEventListener works', function (assert) {
if (typeof Event === "function") {
event = new Event(eventType);
} else {
var qf = document.querySelector('#qunit-fixture');
qf.appendChild(input);
event = document.createEvent('Event');
event.initEvent(eventType, true, false);
}
Expand All @@ -38,6 +38,7 @@ unit.test('domEvents.removeEventListener works', function (assert) {
var eventType = 'click';
var event, event2;
var qf = document.querySelector('#qunit-fixture');
qf.appendChild(input);
var handler = function () {
assert.ok(true, 'event handler should be called');
};
Expand All @@ -47,7 +48,6 @@ unit.test('domEvents.removeEventListener works', function (assert) {
if (typeof Event === "function") {
event = new Event(eventType);
} else {
qf.appendChild(input);
event = document.createEvent('Event');
event.initEvent(eventType, true, true);
}
Expand All @@ -58,9 +58,6 @@ unit.test('domEvents.removeEventListener works', function (assert) {
if (typeof Event === "function") {
event2 = new Event(eventType);
} else {
if (!qf.contains(input)) {
qf.appendChild(input);
}
event2 = document.createEvent('Event');
event2.initEvent(eventType, true, true);
}
Expand Down

0 comments on commit 1181693

Please sign in to comment.