Skip to content

Commit

Permalink
add tests for base goerli client
Browse files Browse the repository at this point in the history
  • Loading branch information
josemarinas committed Jul 28, 2023
1 parent 5627ea4 commit 70e1a26
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions modules/client-common/test/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,32 @@ describe("Test an extended client", () => {
expect(graphqlClient).toBeDefined();

});

it("Should create a client with baseGoerli context parameters", async () => {
const contextParams: ContextParams = {
network: "baseGoerli",
signer: new Wallet(TEST_WALLET),
web3Providers: "https://goerli.base.org"
}
const ctx = new TestContext(contextParams);
const client = new TestClient(ctx);
expect(client).toBeDefined();
expect(ctx).toBeDefined();
expect(client.web3).toBeDefined();
expect(client.ipfs).toBeDefined();
expect(client.graphql).toBeDefined();

const networkName = client.web3.getNetworkName()
expect(networkName).toBe("baseGoerli");
const signer = client.web3.getConnectedSigner();
expect(signer).toBeDefined();
expect(await signer.getAddress()).toBe(TEST_WALLET_ADDRESS);

const ipfsClient = client.ipfs.getClient();
expect(ipfsClient).toBeDefined();
expect(DEFAULT_IPFS_ENDPOINTS.includes(ipfsClient.url.toString())).toBe(true);

const graphqlClient = client.graphql.getClient();
expect(graphqlClient).toBeDefined();
})
});
1 change: 1 addition & 0 deletions modules/client-common/test/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const web3endpoints = {

export const DEFAULT_IPFS_ENDPOINTS = [
"https://prod.ipfs.aragon.network/api/v0/",
"https://test.ipfs.aragon.network/api/v0/",
];

export const TEST_ABI: MetadataAbiInput[] = [
Expand Down

0 comments on commit 70e1a26

Please sign in to comment.