Add underline none

Add space options for Text
This commit is contained in:
Dolan
2022-12-06 22:04:30 +00:00
parent 62b4522c94
commit 1592aa7117
4 changed files with 58 additions and 5 deletions

View File

@ -1,6 +1,7 @@
import { expect } from "chai";
import { Formatter } from "@export/formatter";
import { SpaceType } from "@file/shared";
import { Text } from "./text";
@ -13,5 +14,27 @@ describe("Text", () => {
"w:t": [{ _attr: { "xml:space": "preserve" } }, " this is\n text"],
});
});
it("adds the passed in text to the component with options", () => {
const t = new Text({
text: " this is\n text",
space: SpaceType.PRESERVE,
});
const f = new Formatter().format(t);
expect(f).to.deep.equal({
"w:t": [{ _attr: { "xml:space": "preserve" } }, " this is\n text"],
});
});
it("adds the passed in text to the component with options and sets default space type", () => {
const t = new Text({
text: " this is\n text",
space: SpaceType.DEFAULT,
});
const f = new Formatter().format(t);
expect(f).to.deep.equal({
"w:t": [{ _attr: { "xml:space": "default" } }, " this is\n text"],
});
});
});
});