Skip to content

Commit

Permalink
fix: unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
bluecco committed Dec 17, 2024
1 parent f6192f3 commit 8832874
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
getSessionDomain,
getSessionTypedData,
createSession,
createSessionRequest,
} from "../utils"

type WalletMock = Pick<StarknetWindowObject, "request">
Expand Down Expand Up @@ -159,15 +160,25 @@ describe("Utils", () => {
sessionKey,
}

const accountSessionSignature = await createSession({
address: "0x1234567890abcdef",
authorisationSignature: ["0x123", "0x456"],
const sessionRequest = createSessionRequest({
chainId,
sessionParams,
})

const authorisationSignature = await walletMock.request({
type: "wallet_signTypedData",
params: sessionRequest.sessionTypedData,
})

const session = await createSession({
address: "0x1234567890abcdef",
authorisationSignature,
sessionRequest,
chainId,
})

expect(accountSessionSignature).not.toBeNull()
expect(accountSessionSignature).toStrictEqual({
expect(session).not.toBeNull()
expect(session).toStrictEqual({
sessionKeyGuid:
"0x4bef97e579cdb4c9fa3546db3017a69ddbc40598cd7311359f1e6c03f02b155",
hash: "0x87f8341a9fb39398e15dec07024475dd96406fe4880b9a24d10fb9e6bbf6bd",
Expand Down

0 comments on commit 8832874

Please sign in to comment.