Skip to content

Commit

Permalink
Avoid filling hr elements
Browse files Browse the repository at this point in the history
  • Loading branch information
eskimoblood committed May 14, 2012
1 parent bdbe610 commit 6ae2ad4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
4 changes: 4 additions & 0 deletions fixie.js
Expand Up @@ -126,6 +126,10 @@ function () {
case 'ul':
element.innerHTML = fixie_fetchList();
break;

case 'hr':
console.log('hr')
break;

default:
element.innerHTML = fixie_fetchSentence();
Expand Down
22 changes: 10 additions & 12 deletions test/fetch-test.js
Expand Up @@ -48,6 +48,16 @@ describe("fixie minimal", function () {
createElementAndTestParagraphAndSentecesAndWordCount(tagName, isSame(3), isSame(3), isSame(4));
});
});

['hr'].forEach(function(tagName){

it("should not fill a <" + tagName + ">", function () {
var el = createElementAndInitFixie(tagName);
assert.same('', el.innerHTML);
el.parentNode.removeChild(el);

});
});
});

describe("fixie maximal", function () {
Expand Down Expand Up @@ -80,21 +90,9 @@ describe("fixie maximal", function () {
createElementAndTestParagraphAndSentecesAndWordCount(tagName, isSame(7), isSame(7), isSame(9));
});
});


});

describe('fixie', function()
{
it('should handle sub childs', function () {
var el = createElementAndInitFixie ('div');
el.innerHTML = '<div><header/></div>';
fixie.init();
isBetween(3,5)(el.firstChild.firstChild.innerHTML.split(' ').length);
el.parentNode.removeChild(el);

});
});

function isSame(excpected){
return function(actual) {assert(excpected, actual)};
Expand Down

0 comments on commit 6ae2ad4

Please sign in to comment.