Add work for custom level id

This commit is contained in:
Dolan
2019-11-06 20:54:39 +00:00
parent a622c210ef
commit 9b40b5e55e
7 changed files with 77 additions and 95 deletions

View File

@ -3,7 +3,6 @@ import { assert, expect } from "chai";
import { Formatter } from "export/formatter";
import { EMPTY_OBJECT } from "file/xml-components";
import { Numbering } from "../numbering";
import { AlignmentType, HeadingLevel, LeaderType, PageBreak, TabStopPosition, TabStopType } from "./formatting";
import { Paragraph } from "./paragraph";
@ -596,19 +595,9 @@ describe("Paragraph", () => {
describe("#setNumbering", () => {
it("should add list paragraph style to JSON", () => {
const numbering = new Numbering({
levels: [
{
level: 0,
format: "lowerLetter",
text: "%1)",
},
],
});
const paragraph = new Paragraph({
numbering: {
num: letterNumbering,
reference: "test id",
level: 0,
},
});
@ -627,19 +616,9 @@ describe("Paragraph", () => {
});
it("it should add numbered properties", () => {
const numbering = new Numbering({
levels: [
{
level: 0,
format: "lowerLetter",
text: "%1)",
},
],
});
const paragraph = new Paragraph({
numbering: {
num: letterNumbering,
reference: "test id",
level: 0,
},
});
@ -650,10 +629,7 @@ describe("Paragraph", () => {
"w:pPr": [
{ "w:pStyle": { _attr: { "w:val": "ListParagraph" } } },
{
"w:numPr": [
{ "w:ilvl": { _attr: { "w:val": 0 } } },
{ "w:numId": { _attr: { "w:val": letterNumbering.id } } },
],
"w:numPr": [{ "w:ilvl": { _attr: { "w:val": 0 } } }, { "w:numId": { _attr: { "w:val": "__test id__" } } }],
},
],
},