Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move dapp tests to the root test folder #906

Merged
merged 5 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions dapp/src/tests/factories.ts

This file was deleted.

2 changes: 1 addition & 1 deletion dapp/src/sentry.test.ts → dapp/test/sentry.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it, vi } from "vitest"
import * as Sentry from "@sentry/react"
import sentry from "./sentry"
import sentry from "#/sentry"

describe("sentry", () => {
describe("setUser", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
import { beforeEach, describe, expect, it } from "vitest"
import { createActivity } from "#/tests/factories"
import { Activity } from "#/types"
import { WalletState } from "../wallet"
import reducer, { initialState, setActivities } from "../wallet/walletSlice"
import reducer, {
WalletState,
initialState,
setActivities,
} from "#/store/wallet/walletSlice"
import { dateToUnixTimestamp, randomInteger } from "#/utils"

const createActivity = (overrides: Partial<Activity> = {}): Activity => ({
id: crypto.randomUUID(),
initializedAt: dateToUnixTimestamp() - randomInteger(0, 1000000),
amount: BigInt(randomInteger(1000000, 1000000000)),
txHash: "c9625ecc138bbd241439f158f65f43e152968ff35e203dec89cfb78237d6a2d8",
status: "completed",
type: "deposit",
...overrides,
})

const isSignedMessage = false
const hasFetchedActivities = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest"
import { getEstimatedDuration } from "../activities"
import { getEstimatedDuration } from "#/utils/activities"

describe("Utils functions for activities", () => {
describe("getEstimatedDuration", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest"
import { roundUp } from "../numbers"
import { roundUp } from "#/utils/numbers"

describe("Utils functions for numbers", () => {
describe("roundUp", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Balance } from "@orangekit/react/dist/src/wallet/bitcoin-wallet-provide
import { AcreMessageType } from "@ledgerhq/wallet-api-acre-module"
import { ZeroAddress } from "ethers"
import BigNumber from "bignumber.js"
import AcreLedgerLiveBitcoinProvider from "../bitcoin-provider"
import AcreLedgerLiveBitcoinProvider from "#/utils/orangekit/ledger-live/bitcoin-provider"

describe("AcreLedgerLiveBitcoinProvider", () => {
const bitcoinAddress = "mjc2zGWypwpNyDi4ZxGbBNnUA84bfgiwYc"
Expand Down
Loading