Skip to content

Commit

Permalink
Created test to confirm issue 109
Browse files Browse the repository at this point in the history
  • Loading branch information
pennyfx committed Nov 17, 2014
1 parent f133f83 commit 40b774d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 18 additions & 1 deletion spec/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ describe("x-tag ", function () {
expect(foo.getAttribute('foo-bar')).toEqual('bar');

});

it('setter fooBar should run the validate and pass along the modified value', function (){
var filteredValue;
xtag.register('x-foo-attr-validate', {
Expand Down Expand Up @@ -1211,6 +1211,8 @@ describe("x-tag ", function () {

});



it('extends should allow elements to use other elements base functionality', function(){
xtag.register("x-foo29", {
extends: 'div',
Expand All @@ -1227,6 +1229,21 @@ describe("x-tag ", function () {

});

it('extends should instantiate elements in natural source', function(){
xtag.register("x-extendelement1",{
extends: 'div',
lifecycle: {
created: function() {
var nodes = xtag.createFragment('<div>hello</div>').cloneNode(true);
this.appendChild(nodes);
}
}
});
var foo = document.getElementById('extend_element');
expect(foo.innerHTML).toEqual('<div>hello</div>');
})


it('is="" should bootstrap element', function(){
var count = 0;
xtag.register("x-superdivo", {
Expand Down
1 change: 1 addition & 0 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@
<div id="testbox"></div>
<x-sync id="sync_element"></x-sync>
<x-attr id="attr_element" baz="booze"></x-attr>
<x-extendelement1 id="extend_element" is="div"></x-extendelement1>
</body>
</html>

0 comments on commit 40b774d

Please sign in to comment.