Files
docx-js/src/file/paragraph/formatting/unordered-list.spec.ts

38 lines
1.1 KiB
TypeScript
Raw Normal View History

2019-06-27 01:35:58 +01:00
import { expect } from "chai";
2019-06-27 01:35:58 +01:00
import { Formatter } from "export/formatter";
2018-10-26 01:04:07 +01:00
import { NumberProperties } from "./unordered-list";
2016-07-17 16:28:54 +01:00
describe("NumberProperties", () => {
describe("#constructor()", () => {
it("should create a Number Properties with correct root key", () => {
2021-12-18 15:42:35 +00:00
const numberProperties = new NumberProperties(5, 9);
2019-06-27 01:35:58 +01:00
const tree = new Formatter().format(numberProperties);
expect(tree).to.deep.equal({
"w:numPr": [
{
"w:ilvl": {
_attr: {
2021-12-18 15:42:35 +00:00
"w:val": 9,
2019-06-27 01:35:58 +01:00
},
},
},
{
"w:numId": {
_attr: {
"w:val": 5,
},
},
},
],
});
2016-07-17 16:28:54 +01:00
});
2021-12-18 15:42:35 +00:00
it("should throw an error if level exceeds 9", () => {
expect(() => new NumberProperties(5, 10)).to.throw();
});
2016-07-17 16:28:54 +01:00
});
2017-03-09 22:56:08 +00:00
});