2020-12-24 03:37:43 +00:00
|
|
|
import { expect } from "chai";
|
2021-03-12 03:58:05 +00:00
|
|
|
|
|
|
|
import { convertInchesToTwip, convertMillimetersToTwip, uniqueId, uniqueNumericId } from "./convenience-functions";
|
2020-12-24 03:37:43 +00:00
|
|
|
|
|
|
|
describe("Utility", () => {
|
|
|
|
describe("#convertMillimetersToTwip", () => {
|
|
|
|
it("should call the underlying header's addChildElement for Paragraph", () => {
|
|
|
|
expect(convertMillimetersToTwip(1000)).to.equal(56692);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("#convertInchesToTwip", () => {
|
|
|
|
it("should call the underlying header's addChildElement", () => {
|
|
|
|
expect(convertInchesToTwip(1)).to.equal(1440);
|
|
|
|
expect(convertInchesToTwip(0.5)).to.equal(720);
|
|
|
|
expect(convertInchesToTwip(0.25)).to.equal(360);
|
|
|
|
});
|
|
|
|
});
|
2021-03-12 03:58:05 +00:00
|
|
|
|
|
|
|
describe("#uniqueNumericId", () => {
|
|
|
|
it("should generate a unique ID", () => {
|
|
|
|
// tslint:disable-next-line: no-unused-expression
|
|
|
|
expect(uniqueNumericId()).to.not.be.empty;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("#uniqueId", () => {
|
|
|
|
it("should call the underlying header's addChildElement", () => {
|
|
|
|
// tslint:disable-next-line: no-unused-expression
|
|
|
|
expect(uniqueId()).to.not.be.empty;
|
|
|
|
});
|
|
|
|
});
|
2020-12-24 03:37:43 +00:00
|
|
|
});
|