1
0
Fork 0

Improved test coverage

This commit is contained in:
Joost De Cock 2018-09-06 12:02:43 +02:00
parent 2a99c9fce1
commit dbcfea2a48
2 changed files with 79 additions and 0 deletions

View file

@ -28,3 +28,13 @@ it("Should render attributes with given prefix only", () => {
.set("transform", "scale(1)");
expect(a.renderIfPrefixIs("data-")).to.equal(' text="foo bar" mode="test"');
});
it("Should return attributes as array", () => {
let a = newAttr()
.set("class", "test")
.add("class", "render");
expect(JSON.stringify(a.getAsArray("class"))).to.equal(
JSON.stringify(["test", "render"])
);
expect(a.getAsArray("nope")).to.equal(false);
});