Skip to content

Commit

Permalink
add tests for xlink:href
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Sep 27, 2017
1 parent f7a9ee4 commit 68bcfad
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/core/compiler/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,14 @@ describe("Compiler", function() {
});

it("should compile and mark SVG elements", function() {
var el = createTestElement("compilerSVG", '<svg></svg>');
var el = createTestElement("compilerSVG", '');
var app = new Moon({
root: "#compilerSVG",
template: '<div id="compilerSVG"><svg></svg></div>'
template: '<div id="compilerSVG"><svg><defs><g id="TestLink"><circle/></g></defs><use xlink:href="#TestLink"></use></svg></div>'
});

var use = el.firstChild.firstChild.nextSibling;
expect(use.getAttribute("xlink:href") || use.getAttribute("href")).to.equal("#TestLink");
expect(app.render().children[0].data.SVG).to.equal(1);
});
});

0 comments on commit 68bcfad

Please sign in to comment.