Add underline none
Add space options for Text
This commit is contained in:
@ -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"],
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user