Add tests

This commit is contained in:
Dolan
2018-11-01 02:22:32 +00:00
parent a84eb16392
commit 61411fd0f3
16 changed files with 673 additions and 223 deletions

View File

@ -103,7 +103,7 @@ describe("Anchor", () => {
assert.equal(graphic.rootKey, "a:graphic");
});
it("should create a Drawing with text wrapping", () => {
it("should create a Drawing with square text wrapping", () => {
anchor = createDrawing({
textWrapping: {
textWrapStyle: TextWrapStyle.SQUARE,
@ -116,5 +116,44 @@ describe("Anchor", () => {
const textWrap = newJson.root[6];
assert.equal(textWrap.rootKey, "wp:wrapSquare");
});
it("should create a Drawing with no text wrapping", () => {
anchor = createDrawing({
textWrapping: {
textWrapStyle: TextWrapStyle.NONE,
},
});
const newJson = Utility.jsonify(anchor);
assert.equal(newJson.root.length, 10);
const textWrap = newJson.root[6];
assert.equal(textWrap.rootKey, "wp:wrapNone");
});
it("should create a Drawing with tight text wrapping", () => {
anchor = createDrawing({
textWrapping: {
textWrapStyle: TextWrapStyle.TIGHT,
},
});
const newJson = Utility.jsonify(anchor);
assert.equal(newJson.root.length, 10);
const textWrap = newJson.root[6];
assert.equal(textWrap.rootKey, "wp:wrapTight");
});
it("should create a Drawing with tight text wrapping", () => {
anchor = createDrawing({
textWrapping: {
textWrapStyle: TextWrapStyle.TOP_AND_BOTTOM,
},
});
const newJson = Utility.jsonify(anchor);
assert.equal(newJson.root.length, 10);
const textWrap = newJson.root[6];
assert.equal(textWrap.rootKey, "wp:wrapTopAndBottom");
});
});
});