Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add a test for broken self-closing tag behavior when the tag has attr…

…ibutes
  • Loading branch information...
commit d53e6ba5ec4bd0f9c8e9e849d1678b2161930983 1 parent d3f8eaf
@andrewmbenton authored
Showing with 11 additions and 2 deletions.
  1. +11 −2 test/test.js
View
13 test/test.js
@@ -67,7 +67,7 @@ vows.describe('jup.js').addBatch({
assert.ok( false, topic + " is not the correct tag");
}
},
- "creates a tag with a class":function( topic ){
+ "creates a tag with an attribute":function( topic ){
result = topic.html(["p", {'class': 'klass'}, 'text']);
if( result == '<p class="klass">text</p>'){
assert.ok( true );
@@ -76,7 +76,16 @@ vows.describe('jup.js').addBatch({
assert.ok( false, result + " is not the correct tag");
}
},
- "creates a tag with a data attribute":function( topic ){
+ "creates a self-closing tag with an attribute":function( topic ){
+ result = topic.html(["img", {'class': 'klass'}]);
+ if( result == '<img class="klass"/>'){
+ assert.ok( true );
+ }
+ else{
+ assert.ok( false, result + " is not the correct tag");
+ }
+ },
+ "creates a tag with a hyphenated attribute name":function( topic ){
result = topic.html(["p", {'data-poster': 'poster'}, 'text']);
if( result == '<p data-poster="poster">text</p>'){
assert.ok( true );
Please sign in to comment.
Something went wrong with that request. Please try again.