-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds second half of fix for choojs/nanocomponent #65
- Loading branch information
1 parent
29d6058
commit 985cdc3
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var test = require('tape') | ||
var html = require('bel') | ||
var nanomorph = require('../') | ||
|
||
// FIXME: Need a way to test this... any ideas? | ||
test('do not leak proxy nodes', t => { | ||
var a = html`<ul><li><div><span id="a">leaky?</span></div></li></ul>` | ||
var b = html`<ul><li><span id="a">leaky?</span></li></ul>` | ||
var realNode = html`<span id="a">leaky?</span>` | ||
var proxyA = html`<div id="a" data-proxy=''></div>` | ||
proxyA.realNode = realNode | ||
proxyA.isSameNode = function (el) { | ||
return el === realNode | ||
} | ||
var actual = nanomorph(a, b) | ||
console.log('ACTUAL', actual) | ||
t.ok(actual, actual.outerHTML) | ||
t.end() | ||
}) |