Skip to content

Commit

Permalink
fix: rename method to preventFrameClose
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaushik Shetty committed Jul 6, 2023
1 parent 19d9565 commit bea67e7
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions __test__/fieldModifierLocation/frame.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,19 @@ describe("FieldModifierLocationFrame", () => {
});

describe("preventFrameClose", () => {
it("should not allow user from clicking background", async () => {
await frameInstance.setAllowAppClose(false);
it("should not allow user to close frame by clicking background", async () => {
await frameInstance.preventFrameClose(true);
expect(sendToParent).toHaveBeenCalledTimes(1);
expect(sendToParent).toHaveBeenLastCalledWith("setAllowAppClose", {
isAllowed: false,
expect(sendToParent).toHaveBeenLastCalledWith("preventFrameClose", {
state: true,
});
});

it("should allow user from clicking background", async () => {
await frameInstance.setAllowAppClose(true);
it("should allow user to close frame by clicking background", async () => {
await frameInstance.preventFrameClose(false);
expect(sendToParent).toHaveBeenCalledTimes(1);
expect(sendToParent).toHaveBeenLastCalledWith("setAllowAppClose", {
isAllowed: true,
expect(sendToParent).toHaveBeenLastCalledWith("preventFrameClose", {
state: false,
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/src/fieldModifierLocation/frame.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ declare class FieldModifierLocationFrame {
* Prevent user from accidently closing the app by clicking outside the frame
* if the app is performing some active task.
*/
setAllowAppClose(isAllowed: boolean): Promise<void>;
preventFrameClose(state: boolean): Promise<void>;
/**
* This method enables auto resizing of the extension height.
* @return {FieldModifierLocationFrame}.
Expand Down
2 changes: 1 addition & 1 deletion dist/src/fieldModifierLocation/frame.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/fieldModifierLocation/frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ class FieldModifierLocationFrame {
* Prevent user from accidently closing the app by clicking outside the frame
* if the app is performing some active task.
*/
async setAllowAppClose(isAllowed: boolean) {
await this._connection.sendToParent("setAllowAppClose", {
isAllowed,
async preventFrameClose(state: boolean) {
await this._connection.sendToParent("preventFrameClose", {
state,
});
}

Expand Down

0 comments on commit bea67e7

Please sign in to comment.