Skip to content

Commit

Permalink
test(prependTo): verify first child behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Oct 4, 2018
1 parent 4e007a8 commit 0cdd713
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/spec/prependTo.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,21 @@ describe('prependTo', function() {
expect(result.parentNode).to.eql(svg);
});


it('should prepend as first child', function() {

// given
var svg = create('<svg></svg>');
var group = create('<g id="G" />');

// when
var result = prependTo(group, svg);

// then
expect(result).to.equal(group);
expect(result.parentNode).to.eql(svg);

expect(svg.childNodes).to.have.length(1);
});

});

0 comments on commit 0cdd713

Please sign in to comment.