Skip to content

Commit

Permalink
Update dependencies and fix import paths
Browse files Browse the repository at this point in the history
  • Loading branch information
b3hr4d committed Feb 23, 2024
1 parent c8ee184 commit 7d306ec
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ jobs:
- name: Run Tests
run: |
yarn test
yarn e2e
2 changes: 1 addition & 1 deletion examples/custom-provider/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/agent.test.ts
Original file line number Diff line number Diff line change
@@ -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", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/call.test.ts
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
8 changes: 4 additions & 4 deletions packages/core/test/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,21 @@ describe("CreateActor", () => {
})

it("should initialized the actor", async () => {
expect(agentCallback).toHaveBeenCalledTimes(0)
expect(agentCallback).toHaveBeenCalledTimes(1)
expect(authCallback).toHaveBeenCalledTimes(0)
expect(actorCallback).toHaveBeenCalledTimes(0)

expect(getState().initialized).toEqual(false)

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)
})
Expand Down Expand Up @@ -122,7 +122,7 @@ describe("CreateActor", () => {
expect(authClient).toBeDefined()
expect(identity).toBeDefined()

expect(agentCallback).toHaveBeenCalledTimes(2)
expect(agentCallback).toHaveBeenCalledTimes(3)
expect(authCallback).toHaveBeenCalledTimes(2)
})
})
2 changes: 1 addition & 1 deletion packages/react/src/hooks/useActor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const useActor = <A = BaseActor>(

// Automatically fetch Candid if not already fetched or provided.
useEffect(
() => agentManager.subscribeAgent(fetchCandid),
() => agentManager.subscribeAgent(fetchCandid, !maybeIdlFactory),
[fetchCandid, agentManager]
)

Expand Down
6 changes: 3 additions & 3 deletions packages/react/test/useActor.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe("createReactor", () => {

const { useQueryCall } = extractActorContext(ActorContext)

const LedgerActor = ({ children }) => {
const BackendActor = ({ children }) => {
const { hooks, fetching, fetchError } = useActor<Backend>({
canisterId: "xeka7-ryaaa-aaaal-qb57a-cai",
idlFactory,
Expand Down Expand Up @@ -115,9 +115,9 @@ describe("createReactor", () => {

let screen = renderer.create(
<AgentProvider withDevtools>
<LedgerActor>
<BackendActor>
<CanisterName />
</LedgerActor>
</BackendActor>
</AgentProvider>
)

Expand Down

0 comments on commit 7d306ec

Please sign in to comment.