-
-
Notifications
You must be signed in to change notification settings - Fork 486
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add hyphenation support * Remove unneeded linebreaks * Add documentation and fix eslint * Add tests --------- Co-authored-by: Dolan Miu <[email protected]>
- Loading branch information
Showing
8 changed files
with
206 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/file/document/body/section-properties/properties/line-number.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { describe, expect, it } from "vitest"; | ||
|
||
import { Formatter } from "@export/formatter"; | ||
|
||
import { createLineNumberType } from "./line-number"; | ||
|
||
describe("createLineNumberType", () => { | ||
it("should work", () => { | ||
const textDirection = createLineNumberType({ countBy: 0, start: 0, restart: "newPage", distance: 10 }); | ||
|
||
const tree = new Formatter().format(textDirection); | ||
expect(tree).to.deep.equal({ | ||
"w:lnNumType": { _attr: { "w:countBy": 0, "w:start": 0, "w:restart": "newPage", "w:distance": 10 } }, | ||
}); | ||
}); | ||
|
||
it("should work with string measures for distance", () => { | ||
const textDirection = createLineNumberType({ countBy: 0, start: 0, restart: "newPage", distance: "10mm" }); | ||
|
||
const tree = new Formatter().format(textDirection); | ||
expect(tree).to.deep.equal({ | ||
"w:lnNumType": { _attr: { "w:countBy": 0, "w:start": 0, "w:restart": "newPage", "w:distance": "10mm" } }, | ||
}); | ||
}); | ||
|
||
it("should work with blank entries", () => { | ||
const textDirection = createLineNumberType({}); | ||
|
||
const tree = new Formatter().format(textDirection); | ||
expect(tree).to.deep.equal({ | ||
"w:lnNumType": { _attr: {} }, | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters