forked from SmartDropLabs/smartdrop-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfarmStore.test.ts
More file actions
36 lines (31 loc) · 857 Bytes
/
Copy pathfarmStore.test.ts
File metadata and controls
36 lines (31 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { beforeEach, describe, expect, it } from "vitest";
import { useFarmStore } from "@/store/farmStore";
import type { FarmPosition } from "@/types/farm";
const position: FarmPosition = {
id: "pool-1",
name: "XLM",
img: "",
earned: "1.25",
stake: "10",
dailyRate: "0.5",
totalStakedLiquidity: "$1,000",
symbol: "XLM",
lockedAmount: 10,
lockedAt: 1_700_000_000_000,
lockPeriodSeconds: 86_400,
};
beforeEach(() => {
useFarmStore.setState({
selectedPosition: null,
activeModal: "none",
pendingTxHash: null,
});
});
describe("useFarmStore", () => {
it("opens the unlock modal for the selected position", () => {
useFarmStore.getState().openUnlock(position);
const state = useFarmStore.getState();
expect(state.selectedPosition).toBe(position);
expect(state.activeModal).toBe("unlock");
});
});