can-dom-mutate
Advanced tools
Comparing version 1.3.8 to 1.3.9
@@ -50,14 +50,16 @@ var unit = require('steal-qunit'); | ||
var onNodeInsertionCount = 0; | ||
removeOnInsertionHandler = domMutate.onInsertion(document.documentElement, function () { | ||
switch(onNodeInsertionCount) { | ||
case 0: | ||
assert.equal(insertedEventCount, 1, 'inserted event should trigger for event.currentTarget'); | ||
node.appendChild.call(parent, child); | ||
break; | ||
case 1: | ||
assert.equal(insertedEventCount, 1, 'inserted event should NOT trigger for child of event.currentTarget'); | ||
setTimeout(cleanup, 50); | ||
break; | ||
removeOnInsertionHandler = domMutate.onInsertion(document.documentElement, function (mutation) { | ||
if(mutation.target === parent) { | ||
assert.equal(insertedEventCount, 1, 'inserted event should trigger for event.currentTarget'); | ||
assert.equal(onNodeInsertionCount, 0, 'parent insertion called at right time'); | ||
onNodeInsertionCount++; | ||
node.appendChild.call(parent, child); | ||
} else if(mutation.target === child) { | ||
assert.equal(insertedEventCount, 1, 'inserted event should NOT trigger for child of event.currentTarget'); | ||
assert.equal(onNodeInsertionCount, 1, 'child insertion called at right time'); | ||
onNodeInsertionCount++; | ||
setTimeout(cleanup, 50); | ||
} else { | ||
console.log("dom-events test: mutation fired for non-test element", mutation); | ||
} | ||
onNodeInsertionCount++; | ||
}); | ||
@@ -64,0 +66,0 @@ |
{ | ||
"name": "can-dom-mutate", | ||
"description": "Dispatch and listen for DOM mutations", | ||
"version": "1.3.8", | ||
"version": "1.3.9", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "DoneJS Team", |
@@ -71,6 +71,8 @@ var unit = require('steal-qunit'); | ||
var undo = domMutate.onInsertion(document.documentElement, function (mutation) { | ||
assert.equal(mutation.target, child, 'Node should be the inserted child'); | ||
if(mutation.target === child) { | ||
assert.ok(true, 'Node should be the inserted child'); | ||
undo(); | ||
done(); | ||
undo(); | ||
done(); | ||
} | ||
}); | ||
@@ -127,6 +129,8 @@ | ||
var undo = domMutate.onRemoval(document.documentElement, function (mutation) { | ||
assert.equal(mutation.target, child, 'Node should be the removed child'); | ||
if(mutation.target === child) { | ||
assert.ok(true, 'Node should be the removed child'); | ||
undo(); | ||
done(); | ||
undo(); | ||
done(); | ||
} | ||
}); | ||
@@ -133,0 +137,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
785555
14064
7