Skip to content

Commit

Permalink
feat: adds tests to sign client
Browse files Browse the repository at this point in the history
  • Loading branch information
Gancho Radkov committed May 24, 2023
1 parent ea53453 commit 2a51ac2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/sign-client/test/sdk/client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ describe("Sign Client Integration", () => {
it("init", async () => {
const client = await SignClient.init({ ...TEST_SIGN_CLIENT_OPTIONS, name: "init" });
expect(client).to.be.exist;
expect(client.metadata.redirect).to.exist;
expect(client.metadata.redirect?.universal).to.exist;
expect(client.metadata.redirect?.native).to.not.exist;
await deleteClients({ A: client, B: undefined });
});

Expand All @@ -36,6 +39,12 @@ describe("Sign Client Integration", () => {
const sessionB = clients.B.session.get(sessionA.topic);
expect(sessionB).to.be.exist;
expect(sessionB.pairingTopic).to.eq(sessionA.pairingTopic);
expect(clients.A.metadata.redirect).to.exist;
expect(clients.A.metadata.redirect?.native).to.exist;
expect(clients.A.metadata.redirect?.universal).to.exist;
expect(clients.B.metadata.redirect).to.exist;
expect(clients.B.metadata.redirect?.native).to.exist;
expect(clients.B.metadata.redirect?.universal).to.exist;
await deleteClients(clients);
});
it("connect (with old pairing)", async () => {
Expand Down
17 changes: 17 additions & 0 deletions packages/sign-client/test/shared/values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ export const TEST_SIGN_CLIENT_OPTIONS: SignClientTypes.Options = {
storageOptions: {
database: ":memory:",
},
metadata: {
redirect: {
universal: "App A (Proposer)",
},
name: "App A (Proposer)",
description: "Description of Proposer App run by client A",
url: "https://walletconnect.com",
icons: ["https://avatars.githubusercontent.com/u/37784886"],
},
};

export const TEST_SIGN_CLIENT_OPTIONS_USA: SignClientTypes.Options = {
Expand Down Expand Up @@ -59,6 +68,10 @@ export const TEST_APP_METADATA_A: SignClientTypes.Metadata = {
description: "Description of Proposer App run by client A",
url: "https://walletconnect.com",
icons: ["https://avatars.githubusercontent.com/u/37784886"],
redirect: {
universal: "App A (Proposer)",
native: "App A Native (Proposer)",
},
};

export const TEST_SIGN_CLIENT_NAME_B = "client_b";
Expand All @@ -67,6 +80,10 @@ export const TEST_APP_METADATA_B: SignClientTypes.Metadata = {
description: "Description of Responder App run by client B",
url: "https://walletconnect.com",
icons: ["https://avatars.githubusercontent.com/u/37784886"],
redirect: {
universal: "App B (Responder)",
native: "App B Native (Responder)",
},
};

export const TEST_RELAY_PROTOCOL = "irn";
Expand Down

0 comments on commit 2a51ac2

Please sign in to comment.