add test for ExternalStylesFactory when styles element is missing, to bump coverage

This commit is contained in:
Tom Hunkapiller
2021-05-20 05:03:12 +03:00
parent b627f0982a
commit 780682a8f7

View File

@ -153,6 +153,12 @@ describe("External styles factory", () => {
});
});
it("should throw when style element isn't found", () => {
expect(() => new ExternalStylesFactory().newInstance(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><foo/>`)).to.throw(
"can not find styles element",
);
});
it("should parse styles elements", () => {
// tslint:disable-next-line:no-any
const importedStyle = new ExternalStylesFactory().newInstance(externalStyles) as any;