Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKurt committed May 31, 2024
1 parent 4de4b74 commit 603c689
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 13 deletions.
1 change: 0 additions & 1 deletion packages/common/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Round } from "data-layer";
import { Hex } from "viem";
import { AnyJson } from ".";
import { BigNumber } from "ethers";

Expand Down
6 changes: 3 additions & 3 deletions packages/grant-explorer/src/cartStore.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe("useCartStorage Zustand store", () => {
});

test("should set payout token for a specific chain", () => {
const chainId: number = 1;
const chainId = 1;
const payoutToken: TToken = defaultVotingTokens[1];

useCartStorage.getState().setVotingTokenForChain(chainId, payoutToken);
Expand All @@ -114,7 +114,7 @@ describe("useCartStorage Zustand store", () => {
});

test("should update donations for all projects with a specific chain", () => {
const chainId: number = 1;
const chainId = 1;

const project1: CartProject = makeApprovedProjectData();
const project2: CartProject = makeApprovedProjectData();
Expand Down Expand Up @@ -146,7 +146,7 @@ describe("useCartStorage Zustand store", () => {
});

test("should override voting token for a specific chain", () => {
const chainId: number = 1;
const chainId = 1;
const initialVotingToken: TToken = defaultVotingTokens[1];
const newVotingToken: TToken = defaultVotingTokens[1];

Expand Down
6 changes: 3 additions & 3 deletions packages/grant-explorer/src/checkoutStore.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe("Checkout Store", () => {

it("permitStatus manipulation", async () => {
const store = useCheckoutStore;
const chain: number = 1;
const chain = 1;

// Initially, the status should be NOT_STARTED for all chains
expect(store.getState().permitStatus[chain]).toEqual(
Expand All @@ -29,7 +29,7 @@ describe("Checkout Store", () => {
});

it("voteStatus manipulation", async () => {
const chain: number = 1;
const chain = 1;

expect(store.getState().voteStatus[chain]).toEqual(
ProgressStatus.NOT_STARTED
Expand All @@ -42,7 +42,7 @@ describe("Checkout Store", () => {
});

it("chainSwitchStatus manipulation", async () => {
const chain: number = 1;
const chain = 1;

expect(store.getState().chainSwitchStatus[chain]).toEqual(
ProgressStatus.NOT_STARTED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe("useFilterRounds", () => {
);

await waitFor(() =>
expect(result?.current.data?.length!).toBe(
expect(result?.current.data?.length).toBe(
mockedRoundsOverAllChains.length
)
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Chain } from "wagmi/chains";
import { useRounds } from "../../api/rounds";
import { createRoundsStatusFilter } from "../utils/createRoundsStatusFilter";
import { SWRResponse } from "swr";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ describe("listPrograms", () => {
it("calls the indexer endpoint", async () => {
// const address = "0x0"
let expectedProgram = makeProgramData({
chain: getChainById(1),
chain: {
id: 1,
name: "Ethereum",
},
});
expectedProgram = {
...expectedProgram,
Expand Down Expand Up @@ -61,7 +64,10 @@ describe("listPrograms", () => {
describe("getProgramById", () => {
it("calls the graphql endpoint and maps the metadata from IPFS", async () => {
const expectedProgram = makeProgramData({
chain: getChainById(1),
chain: {
name: "Ethereum",
id: 1,
},
});
const programId = expectedProgram.id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const mockWallet = {
},
},
chain: {
id: "1",
id: 1,
name: "Ethereum",
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default function ApplicationDirectPayout({ round, application }: Props) {

const [tokenInfo, setTokenInfo] = useState(tokensByChainInfo[0]);
const [selectedToken, setSelectedToken] = useState<Hex | "custom">(
tokenInfo.address
tokenInfo.address || "custom"
);
const [customTokenInput, setCustomTokenInput] = useState("");
const [payoutTokensMap, setPayoutTokensMap] = useState<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const mockWallet = {
},
chain: {
name: "abc",
id: 1,
},
};
const mockNetwork = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const mockWallet = {
},
chain: {
name: "abc",
id: 1,
},
};

Expand Down

0 comments on commit 603c689

Please sign in to comment.