2017-03-07 22:15:53 +00:00
|
|
|
import { assert } from "chai";
|
2017-09-17 00:00:41 +01:00
|
|
|
|
2017-09-30 01:52:37 +01:00
|
|
|
import { Utility } from "../../../tests/utility";
|
2017-09-17 00:00:41 +01:00
|
|
|
import { NumberProperties } from "./unordered-list";
|
2016-07-17 16:28:54 +01:00
|
|
|
|
|
|
|
describe("NumberProperties", () => {
|
|
|
|
let numberProperties: NumberProperties;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
2017-03-07 19:14:57 +01:00
|
|
|
numberProperties = new NumberProperties(5, 10);
|
2016-07-17 16:28:54 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should create a Number Properties with correct root key", () => {
|
2017-03-09 22:31:55 +00:00
|
|
|
const newJson = Utility.jsonify(numberProperties);
|
2016-07-17 16:28:54 +01:00
|
|
|
assert.equal(newJson.rootKey, "w:numPr");
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should create a Page Break with a Indent Level inside", () => {
|
2017-03-09 22:31:55 +00:00
|
|
|
const newJson = Utility.jsonify(numberProperties);
|
2016-07-17 16:28:54 +01:00
|
|
|
assert.equal(newJson.root[0].rootKey, "w:ilvl");
|
2017-03-07 19:14:57 +01:00
|
|
|
assert.equal(newJson.root[0].root[0].root.val, 10);
|
2016-07-17 16:28:54 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
it("should create a Page Break with a Number Id inside", () => {
|
2017-03-09 22:31:55 +00:00
|
|
|
const newJson = Utility.jsonify(numberProperties);
|
2016-07-17 16:28:54 +01:00
|
|
|
assert.equal(newJson.root[1].rootKey, "w:numId");
|
2017-03-07 19:14:57 +01:00
|
|
|
assert.equal(newJson.root[1].root[0].root.val, 5);
|
2016-07-17 16:28:54 +01:00
|
|
|
});
|
|
|
|
});
|
2017-03-09 22:56:08 +00:00
|
|
|
});
|