Skip to content

Commit

Permalink
remove costly tests
Browse files Browse the repository at this point in the history
  • Loading branch information
b3hr4d committed Feb 23, 2024
1 parent 7d306ec commit d40e7ed
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ lerna-debug.log
yarn-error.log

pulled.json
examples/candid-react
examples/candid-ui
examples/*/deps/candid
docs
.nx
22 changes: 11 additions & 11 deletions packages/core/test/call.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ describe("My IC Store and Actions", () => {
expect(key).toBeDefined()
})

const mockData = Uint8Array.from(Array(48).fill(0))
// const mockData = Uint8Array.from(Array(48).fill(0))
const publicKey = Uint8Array.from(randomBytes(48))

it("should return anonymous user data", async () => {
const index = await callMethod("save_encrypted_text", mockData, [publicKey])
// it("should return anonymous user data", async () => {
// const index = await callMethod("save_encrypted_text", mockData, [publicKey])

expect(index).toBeDefined()
// expect(index).toBeDefined()

const savedData = await callMethod("user_notes", [publicKey])
// const savedData = await callMethod("user_notes", [publicKey])

expect(savedData[1][0].text).toEqual(mockData)
})
// expect(savedData[1][0].text).toEqual(mockData)
// })

it("should return logged user data", async () => {
await agentManager.authenticate()
Expand All @@ -43,9 +43,9 @@ describe("My IC Store and Actions", () => {
expect(data).toBeDefined()
})

it("should transfrom", async () => {
const data = await callMethod("anonymous_user_notes", publicKey)
// it("should transfrom", async () => {
// const data = await callMethod("anonymous_user_notes", publicKey)

expect(data).toBeDefined()
})
// expect(data).toBeDefined()
// })
})
56 changes: 28 additions & 28 deletions packages/core/test/reactor.simple.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,47 +18,47 @@ describe("My IC Store and Actions", () => {
expect(data).toBeDefined()
})

it("should return anonymous user data", async () => {
const mockData = Uint8Array.from(Array(48).fill(0))
const publicKey = Uint8Array.from(randomBytes(48))
// it("should return anonymous user data", async () => {
// const mockData = Uint8Array.from(Array(48).fill(0))
// const publicKey = Uint8Array.from(randomBytes(48))

const { call: save_encrypted_text, getState } = updateCall({
functionName: "save_encrypted_text",
args: [mockData, [publicKey]],
})
// const { call: save_encrypted_text, getState } = updateCall({
// functionName: "save_encrypted_text",
// args: [mockData, [publicKey]],
// })

const index = await save_encrypted_text()
// const index = await save_encrypted_text()

expect(index).toBeDefined()
// expect(index).toBeDefined()

const stateIndex = getState("data")
// const stateIndex = getState("data")

expect(stateIndex).toEqual(index)
// expect(stateIndex).toEqual(index)

const {
call,
dataPromise,
getState: userState,
} = queryCall({
functionName: "anonymous_user_notes",
args: [publicKey],
refetchOnMount: true,
})
// const {
// call,
// dataPromise,
// getState: userState,
// } = queryCall({
// functionName: "anonymous_user_notes",
// args: [publicKey],
// refetchOnMount: true,
// })

expect(userState("loading")).toEqual(true)
// expect(userState("loading")).toEqual(true)

const data = await dataPromise
// const data = await dataPromise

const stateData = userState("data")
// const stateData = userState("data")

expect(data).toEqual(stateData)
// expect(data).toEqual(stateData)

expect(userState("loading")).toEqual(false)
// expect(userState("loading")).toEqual(false)

const recallData = await call()
// const recallData = await call()

expect(recallData).toBeDefined()
})
// expect(recallData).toBeDefined()
// })

it("should return timers", async () => {
const { intervalId, dataPromise } = queryCall({
Expand Down

0 comments on commit d40e7ed

Please sign in to comment.