Skip to content

Commit

Permalink
Merge branch 'master' into user/millerds/update-node-check
Browse files Browse the repository at this point in the history
  • Loading branch information
millerds committed May 3, 2024
2 parents 16ae81e + b7825fe commit 81c58bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/office-addin-mock/src/officeMockObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class OfficeMockObject {
}
let properties: string[] = [];

if (propertyArgument === undefined) {
if (propertyArgument === undefined) {
// an empty load call mean load all properties
properties = ["*"];
} else if (typeof propertyArgument === "string") {
Expand All @@ -47,6 +47,8 @@ export class OfficeMockObject {
properties.forEach((property: string) => {
this.loadMultipleProperties(property);
});

return this;
}

/**
Expand Down
7 changes: 7 additions & 0 deletions packages/office-addin-mock/test/officeMockObject.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ describe("Test OfficeMockObject class", function() {

assert.strictEqual(officeMock.notAProperty, undefined);
});
it("Load call with assignment", async function() {
const officeMock = new OfficeMockObject(testObject);

const range = officeMock.range.load("color");
await officeMock.sync();
assert.strictEqual(range.color, "blue");
});
it("Missing load", async function() {
const officeMock = new OfficeMockObject(testObject);
assert.strictEqual(officeMock.range.color, "Error, property was not loaded");
Expand Down

0 comments on commit 81c58bf

Please sign in to comment.