diff --git a/.github/workflows/deploy-test.yml b/.github/workflows/deploy-test.yml index 016742663f..b68d97134d 100644 --- a/.github/workflows/deploy-test.yml +++ b/.github/workflows/deploy-test.yml @@ -28,4 +28,3 @@ jobs: - name: Run Tests run: | yarn test - yarn e2e diff --git a/examples/custom-provider/src/App.tsx b/examples/custom-provider/src/App.tsx index 416a4c137c..80d792acee 100644 --- a/examples/custom-provider/src/App.tsx +++ b/examples/custom-provider/src/App.tsx @@ -8,7 +8,7 @@ import { useRef, useState } from "react" import { IC_HOST_NETWORK_URI, LOCAL_HOST_NETWORK_URI, -} from "@ic-reactor/core/dist/tools" +} from "@ic-reactor/core/dist/utils" interface AppProps {} diff --git a/packages/core/test/agent.test.ts b/packages/core/test/agent.test.ts index 83871e747c..6bfbdc6e5e 100644 --- a/packages/core/test/agent.test.ts +++ b/packages/core/test/agent.test.ts @@ -1,4 +1,4 @@ -import { IC_HOST_NETWORK_URI } from "../src/tools" +import { IC_HOST_NETWORK_URI } from "../src/utils" import { createAgentManager } from "../src" describe("My IC Network agent", () => { diff --git a/packages/core/test/call.test.ts b/packages/core/test/call.test.ts index ad25c3e936..d11e3f4357 100644 --- a/packages/core/test/call.test.ts +++ b/packages/core/test/call.test.ts @@ -1,7 +1,7 @@ import { randomBytes } from "crypto" import { idlFactory, backend } from "./candid/backend" import { createActorManager, createAgentManager } from "../src" -import { IC_HOST_NETWORK_URI } from "../src/tools" +import { IC_HOST_NETWORK_URI } from "../src/utils" describe("My IC Store and Actions", () => { const agentManager = createAgentManager({ diff --git a/packages/core/test/init.test.ts b/packages/core/test/init.test.ts index 3012bfb139..d96c7ec111 100644 --- a/packages/core/test/init.test.ts +++ b/packages/core/test/init.test.ts @@ -65,7 +65,7 @@ describe("CreateActor", () => { }) it("should initialized the actor", async () => { - expect(agentCallback).toHaveBeenCalledTimes(0) + expect(agentCallback).toHaveBeenCalledTimes(1) expect(authCallback).toHaveBeenCalledTimes(0) expect(actorCallback).toHaveBeenCalledTimes(0) @@ -73,13 +73,13 @@ describe("CreateActor", () => { const promise = initialize() - expect(agentCallback).toHaveBeenCalledTimes(1) + expect(agentCallback).toHaveBeenCalledTimes(2) expect(authCallback).toHaveBeenCalledTimes(0) expect(actorCallback).toHaveBeenCalledTimes(2) await promise - expect(agentCallback).toHaveBeenCalledTimes(1) + expect(agentCallback).toHaveBeenCalledTimes(2) expect(authCallback).toHaveBeenCalledTimes(0) expect(actorCallback).toHaveBeenCalledTimes(2) }) @@ -122,7 +122,7 @@ describe("CreateActor", () => { expect(authClient).toBeDefined() expect(identity).toBeDefined() - expect(agentCallback).toHaveBeenCalledTimes(2) + expect(agentCallback).toHaveBeenCalledTimes(3) expect(authCallback).toHaveBeenCalledTimes(2) }) }) diff --git a/packages/react/src/hooks/useActor.ts b/packages/react/src/hooks/useActor.ts index 1a2c75462a..8332423f0f 100644 --- a/packages/react/src/hooks/useActor.ts +++ b/packages/react/src/hooks/useActor.ts @@ -127,7 +127,7 @@ export const useActor = ( // Automatically fetch Candid if not already fetched or provided. useEffect( - () => agentManager.subscribeAgent(fetchCandid), + () => agentManager.subscribeAgent(fetchCandid, !maybeIdlFactory), [fetchCandid, agentManager] ) diff --git a/packages/react/test/useActor.spec.tsx b/packages/react/test/useActor.spec.tsx index c1d1ee42da..1d28c0cd72 100644 --- a/packages/react/test/useActor.spec.tsx +++ b/packages/react/test/useActor.spec.tsx @@ -79,7 +79,7 @@ describe("createReactor", () => { const { useQueryCall } = extractActorContext(ActorContext) - const LedgerActor = ({ children }) => { + const BackendActor = ({ children }) => { const { hooks, fetching, fetchError } = useActor({ canisterId: "xeka7-ryaaa-aaaal-qb57a-cai", idlFactory, @@ -115,9 +115,9 @@ describe("createReactor", () => { let screen = renderer.create( - + - + )