Documentation and Refactoring (#3028)
* Documentation and Refactoring * Documentation and Refactoring * Fix lint issues * Convert components to Builder style --------- Co-authored-by: Dolan Miu <dmiu@bloomberg.net>
This commit is contained in:
@ -2,26 +2,26 @@ import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
import { DocumentGrid, DocumentGridType } from ".";
|
||||
import { DocumentGridType, createDocumentGrid } from ".";
|
||||
|
||||
describe("DocumentGrid", () => {
|
||||
describe("createDocumentGrid", () => {
|
||||
describe("#constructor()", () => {
|
||||
it("should create documentGrid with specified linePitch", () => {
|
||||
const docGrid = new DocumentGrid(360);
|
||||
const docGrid = createDocumentGrid({ linePitch: 360 });
|
||||
const tree = new Formatter().format(docGrid);
|
||||
|
||||
expect(tree["w:docGrid"]).to.deep.equal({ _attr: { "w:linePitch": 360 } });
|
||||
});
|
||||
|
||||
it("should create documentGrid with specified linePitch and type", () => {
|
||||
const docGrid = new DocumentGrid(360, undefined, DocumentGridType.LINES);
|
||||
const docGrid = createDocumentGrid({ linePitch: 360, type: DocumentGridType.LINES });
|
||||
const tree = new Formatter().format(docGrid);
|
||||
|
||||
expect(tree["w:docGrid"]).to.deep.equal({ _attr: { "w:linePitch": 360, "w:type": "lines" } });
|
||||
});
|
||||
|
||||
it("should create documentGrid with specified linePitch,charSpace and type", () => {
|
||||
const docGrid = new DocumentGrid(346, -1541, DocumentGridType.LINES_AND_CHARS);
|
||||
const docGrid = createDocumentGrid({ linePitch: 346, charSpace: -1541, type: DocumentGridType.LINES_AND_CHARS });
|
||||
const tree = new Formatter().format(docGrid);
|
||||
|
||||
expect(tree["w:docGrid"]).to.deep.equal({ _attr: { "w:linePitch": 346, "w:charSpace": -1541, "w:type": "linesAndChars" } });
|
||||
|
Reference in New Issue
Block a user