Skip to content

Commit

Permalink
explorer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKurt committed May 31, 2024
1 parent 5a953da commit 6a985a5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
13 changes: 2 additions & 11 deletions packages/grant-explorer/src/app/chainConfig.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
import { getChains, TChain } from "common";
import { chainIds } from "common/src/chains";

const ensureValidChainId = (chain: TChain) => {
if (Object.values(chainIds).includes(chain.id)) {
return chain;
} else {
throw new Error(`Chain id not recognized: ${chain.id}`);
}
};

const testnetChains = () => {
return getChains().filter((chain) => chain.type === "testnet");
Expand All @@ -17,8 +8,8 @@ const mainnetChains = () => {
return getChains().filter((chain) => chain.type === "mainnet");
};

const TESTNET_CHAINS = testnetChains().map(ensureValidChainId);
const MAINNET_CHAINS = mainnetChains().map(ensureValidChainId);
const TESTNET_CHAINS = testnetChains();
const MAINNET_CHAINS = mainnetChains();

export const getEnabledChains = (): TChain[] => {
switch (process.env.REACT_APP_ENV) {
Expand Down
Binary file modified packages/grant-explorer/src/features/api/__tests__/voting.test.tsx
Binary file not shown.
3 changes: 1 addition & 2 deletions packages/grant-explorer/src/setupTests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { expect, afterEach } from "vitest";
import "@testing-library/jest-dom";
import { cleanup } from "@testing-library/react";
import matchers from "@testing-library/jest-dom/matchers";
import createFetchMock from "vitest-fetch-mock";
Expand Down Expand Up @@ -49,4 +48,4 @@ beforeEach(() => {
})),
});
});
global.URL.createObjectURL = jest.fn(() => "mocked-url");
global.URL.createObjectURL = vi.fn(() => "mocked-url");

0 comments on commit 6a985a5

Please sign in to comment.