Skip to content

Commit

Permalink
Ensure prototype wasn't affected by runtime effects.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Apr 12, 2017
1 parent 1471106 commit bf2dbe0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/unit/property-effects.html
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@

suite('runtime effects', function() {

var el;
var el, el2;

setup(function() {
el = document.createElement('x-basic');
Expand All @@ -1411,6 +1411,7 @@

teardown(function() {
document.body.removeChild(el);
document.body.removeChild(el2);
});

test('add/remove runtime property effect', function() {
Expand All @@ -1429,6 +1430,10 @@
el._removePropertyEffect('value', el.PROPERTY_EFFECT_TYPES.OBSERVE, effect);
el.value = 'value+++';
assert.equal(fn.callCount, 1);
// Ensure prototype wasn't affected
el2 = document.createElement('x-basic');
document.body.appendChild(el2);
assert.equal(fn.callCount, 1);
});

test('add/remove runtime path effect', function() {
Expand All @@ -1455,6 +1460,10 @@
el._removePropertyEffect('value', el.PROPERTY_EFFECT_TYPES.OBSERVE, effect);
el.set('value.path', 'value.path+++');
assert.equal(fn.callCount, 2);
// Ensure prototype wasn't affected
el2 = document.createElement('x-basic');
document.body.appendChild(el2);
assert.equal(fn.callCount, 2);
});

});
Expand Down

0 comments on commit bf2dbe0

Please sign in to comment.