From 8a93eb3181a7700b4eb8f260144183ac2c9abe03 Mon Sep 17 00:00:00 2001 From: yjin Date: Wed, 8 Jan 2025 22:56:24 +0900 Subject: [PATCH] test: [GSW-2040] Update Test Code --- .../NotificationButton.spec.tsx | 9 ++++--- .../AssetReceiveModal.spec.tsx | 5 +++- .../wallet-balance/WalletBalance.spec.tsx | 14 ++++++++++ .../WalletBalanceSummary.spec.tsx | 26 ++++++++++++++++--- 4 files changed, 47 insertions(+), 7 deletions(-) diff --git a/packages/web/src/components/common/header/notification-button/NotificationButton.spec.tsx b/packages/web/src/components/common/header/notification-button/NotificationButton.spec.tsx index 44522a4c7..d61d0342c 100644 --- a/packages/web/src/components/common/header/notification-button/NotificationButton.spec.tsx +++ b/packages/web/src/components/common/header/notification-button/NotificationButton.spec.tsx @@ -9,6 +9,7 @@ import { DEVICE_TYPE } from "@styles/media"; import { createMockRouter } from "@test/createMockRouter"; import NotificationButton from "./NotificationButton"; +import SocialWalletProvider from "@providers/social-wallet-provider"; describe("NotificationButton Component", () => { it("Notification button", () => { @@ -31,9 +32,11 @@ describe("NotificationButton Component", () => { - - - + + + + + diff --git a/packages/web/src/components/wallet/asset-receive-modal/AssetReceiveModal.spec.tsx b/packages/web/src/components/wallet/asset-receive-modal/AssetReceiveModal.spec.tsx index 2e2959c2c..9d6ecfac4 100644 --- a/packages/web/src/components/wallet/asset-receive-modal/AssetReceiveModal.spec.tsx +++ b/packages/web/src/components/wallet/asset-receive-modal/AssetReceiveModal.spec.tsx @@ -9,6 +9,7 @@ import { DEVICE_TYPE } from "@styles/media"; import { createMockRouter } from "@test/createMockRouter"; import AssetReceiveModal, { DEFAULT_DEPOSIT_GNOT } from "./AssetReceiveModal"; +import SocialWalletProvider from "@providers/social-wallet-provider"; describe("AssetReceiveModal Component", () => { it("AssetReceiveModal render", () => { @@ -37,7 +38,9 @@ describe("AssetReceiveModal Component", () => { - + + + diff --git a/packages/web/src/layouts/wallet/components/wallet-balance/WalletBalance.spec.tsx b/packages/web/src/layouts/wallet/components/wallet-balance/WalletBalance.spec.tsx index 8954b0f85..0baf8ff2b 100644 --- a/packages/web/src/layouts/wallet/components/wallet-balance/WalletBalance.spec.tsx +++ b/packages/web/src/layouts/wallet/components/wallet-balance/WalletBalance.spec.tsx @@ -3,6 +3,7 @@ import { Provider as JotaiProvider } from "jotai"; import GnoswapThemeProvider from "@providers/gnoswap-theme-provider/GnoswapThemeProvider"; import WalletBalance from "./WalletBalance"; import { DEVICE_TYPE } from "@styles/media"; +import { WalletType } from "src/types/wallet.types"; describe("WalletBalance Component", () => { it("WalletBalance render", () => { @@ -11,13 +12,26 @@ describe("WalletBalance Component", () => { balanceSummaryInfo: { amount: "$1,000.00", changeRate: "+1.1%", + loading: false, }, balanceDetailInfo: { availableBalance: "1.10%", stakedLP: "1.20%", unstakedLP: "1.30%", claimableRewards: "1.40%", + loadingBalance: false, + loadingPositions: false, + totalClaimedRewards: "0", }, + isSwitchNetwork: false, + loadngTransactionClaim: false, + positions: [], + tokenPrices: {}, + walletType: { + type: "ADENA" as WalletType, + socialType: null, + }, + deposit: () => null, withdraw: () => null, claimAll: () => null, diff --git a/packages/web/src/layouts/wallet/components/wallet-balance/wallet-balance-summary/WalletBalanceSummary.spec.tsx b/packages/web/src/layouts/wallet/components/wallet-balance/wallet-balance-summary/WalletBalanceSummary.spec.tsx index 6ae3b4e49..374cf0f35 100644 --- a/packages/web/src/layouts/wallet/components/wallet-balance/wallet-balance-summary/WalletBalanceSummary.spec.tsx +++ b/packages/web/src/layouts/wallet/components/wallet-balance/wallet-balance-summary/WalletBalanceSummary.spec.tsx @@ -3,18 +3,38 @@ import { Provider as JotaiProvider } from "jotai"; import GnoswapThemeProvider from "@providers/gnoswap-theme-provider/GnoswapThemeProvider"; import WalletBalanceSummary from "./WalletBalanceSummary"; import { DEVICE_TYPE } from "@styles/media"; +import { WalletType } from "src/types/wallet.types"; describe("WalletBalanceSummary Component", () => { it("WalletBalanceSummary render", () => { const mockProps = { connected: true, balanceSummaryInfo: { - amount: "1,000.00", - changeRate: "+1.10%", + amount: "$1,000.00", + changeRate: "+1.1%", + loading: false, }, + balanceDetailInfo: { + availableBalance: "1.10%", + stakedLP: "1.20%", + unstakedLP: "1.30%", + claimableRewards: "1.40%", + loadingBalance: false, + loadingPositions: false, + totalClaimedRewards: "0", + }, + isSwitchNetwork: false, + loadngTransactionClaim: false, + positions: [], + tokenPrices: {}, + walletType: { + type: "ADENA" as WalletType, + socialType: null, + }, + deposit: () => null, withdraw: () => null, - windowSize: 900, + claimAll: () => null, breakpoint: DEVICE_TYPE.WEB, };