diff --git a/tests/components/context_menu.test.ts b/tests/components/context_menu.test.ts index aa3771e07..b512c069e 100644 --- a/tests/components/context_menu.test.ts +++ b/tests/components/context_menu.test.ts @@ -132,13 +132,23 @@ const subMenu: FullMenuItem[] = [ ]; const originalGetBoundingClientRect = HTMLDivElement.prototype.getBoundingClientRect; -// @ts-ignore the mock should return a complete DOMRect, not only { top, left } jest .spyOn(HTMLDivElement.prototype, "getBoundingClientRect") .mockImplementation(function (this: HTMLDivElement) { const menu = this.className.includes("o-menu"); if (menu) { - return getPosition(this); + const position = getPosition(this); + return { + top: position.top, + left: position.left, + bottom: position.top + this.clientHeight, + right: position.left + this.clientWidth, + width: this.clientWidth, + height: this.clientHeight, + x: position.left, + y: position.top, + toJSON: () => "", + }; } return originalGetBoundingClientRect.call(this); }); diff --git a/tsconfig.json b/tsconfig.json index 30fb086b8..6a061cac4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,7 +17,8 @@ "esModuleInterop": true, "allowJs": true, "preserveWatchOutput": true, - "sourceMap": true + "sourceMap": true, + "strictBindCallApply": true }, "include": ["src"], "typedocOptions": {