Adding tests for noProof option
This commit is contained in:
committed by
Dolan Miu
parent
df619ffe49
commit
36e9ac1179
@ -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({
|
||||
|
Reference in New Issue
Block a user