diff --git a/package-lock.json b/package-lock.json index c5ce83e..92b7611 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "@hcaptcha/react-hcaptcha", - "version": "1.9.2", + "version": "1.9.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@hcaptcha/react-hcaptcha", - "version": "1.9.2", + "version": "1.9.3", "license": "MIT", "dependencies": { "@babel/runtime": "^7.17.9", - "@hcaptcha/loader": "^1.0.10" + "@hcaptcha/loader": "^1.1.2" }, "devDependencies": { "@babel/cli": "^7.12.1", @@ -1698,9 +1698,9 @@ } }, "node_modules/@hcaptcha/loader": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/@hcaptcha/loader/-/loader-1.0.10.tgz", - "integrity": "sha512-aWrYY47l42O/7OhPDOYD1Xwl0pa3tmMAOu8yNTuuhcwRme0MDw3mMNG7EhAF4wqyE8SAr7kXiWYp+ryOnfS8EQ==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@hcaptcha/loader/-/loader-1.1.2.tgz", + "integrity": "sha512-YEBXCGNUBpPJUd5UZg64jBU6YMOhDjGdzS6dUCI9P8uIJttuQz3P76wVmK9kdKOuvLUaB7HwVBBmNv/bkAaIEw==" }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", @@ -11842,9 +11842,9 @@ "dev": true }, "@hcaptcha/loader": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/@hcaptcha/loader/-/loader-1.0.10.tgz", - "integrity": "sha512-aWrYY47l42O/7OhPDOYD1Xwl0pa3tmMAOu8yNTuuhcwRme0MDw3mMNG7EhAF4wqyE8SAr7kXiWYp+ryOnfS8EQ==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@hcaptcha/loader/-/loader-1.1.2.tgz", + "integrity": "sha512-YEBXCGNUBpPJUd5UZg64jBU6YMOhDjGdzS6dUCI9P8uIJttuQz3P76wVmK9kdKOuvLUaB7HwVBBmNv/bkAaIEw==" }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", diff --git a/package.json b/package.json index 3f72334..741dce9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hcaptcha/react-hcaptcha", - "version": "1.9.2", + "version": "1.9.3", "types": "types/index.d.ts", "main": "dist/index.js", "module": "dist/esm/index.js", @@ -59,6 +59,6 @@ }, "dependencies": { "@babel/runtime": "^7.17.9", - "@hcaptcha/loader": "^1.0.10" + "@hcaptcha/loader": "^1.1.2" } } diff --git a/tests/hcaptcha.spec.js b/tests/hcaptcha.spec.js index a3f8819..5e82dd2 100644 --- a/tests/hcaptcha.spec.js +++ b/tests/hcaptcha.spec.js @@ -4,7 +4,7 @@ import ReactTestUtils, { act } from "react-dom/test-utils"; import { describe, jest, it } from "@jest/globals"; -import {getMockedHcaptcha, MOCK_EKEY, MOCK_TOKEN, MOCK_WIDGET_ID} from "./hcaptcha.mock"; +import { getMockedHcaptcha, MOCK_EKEY, MOCK_TOKEN, MOCK_WIDGET_ID } from "./hcaptcha.mock"; let HCaptcha; @@ -503,27 +503,6 @@ describe("hCaptcha", () => { expect(script.src).toContain("custom=true"); }); - it("emits error when script is failed", async () => { - const onError = jest.fn(); - - instance = ReactTestUtils.renderIntoDocument(); - - const script = document.querySelector("head > script"); - expect(onError.mock.calls.length).toBe(0); - - script.onerror(new Error('loading failed')); - - // simulate microtask - await Promise.reject().catch(() => null) - - expect(onError.mock.calls.length).toBe(1); - expect(onError.mock.calls[0][0].message).toEqual("script-error"); - }); - it("should have async set by default", () => { instance = ReactTestUtils.renderIntoDocument(