Adding tests for noProof option

This commit is contained in:
Pulpgrinder Dev Team
2023-05-11 20:49:09 -08:00
committed by Dolan Miu
parent df619ffe49
commit 36e9ac1179

View File

@ -8,8 +8,38 @@ import { EmphasisMarkType } from "./emphasis-mark";
import { PageNumber, Run } from "./run";
import { UnderlineType } from "./underline";
import { TextEffect } from "./properties";
describe("Run", () => {
describe("#noproof()", () => {
it("turns off spelling and grammar checkers for a run", () => {
const run = new Run({
noProof: true,
});
const tree = new Formatter().format(run);
expect(tree).to.deep.equal({
"w:r": [
{
"w:rPr": [
{ "w:noProof": {} },
],
},
],
});
});
const run = new Run({
noProof: false,
});
const tree = new Formatter().format(run);
expect(tree).to.deep.equal({
"w:r": [
{
"w:rPr": [
{ "w:noProof": { _attr: { "w:val": false } } },
],
},
],
});
});
describe("#bold()", () => {
it("it should add bold to the properties", () => {
const run = new Run({