Skip to content

Commit

Permalink
fix: lint/tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alessey committed Dec 13, 2024
1 parent baa0bea commit bea62e2
Show file tree
Hide file tree
Showing 42 changed files with 120 additions and 354 deletions.
2 changes: 1 addition & 1 deletion src/core-react/nft/hooks/useMintData.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useNFTLifecycleContext } from '../providers/NFTLifecycleProvider';
import { useMintData } from './useMintData';
import { useMintDetails } from './useMintDetails';

vi.mock('../components/NFTLifecycleProvider');
vi.mock('../providers/NFTLifecycleProvider');
vi.mock('./useMintDetails');
vi.mock('wagmi');

Expand Down
2 changes: 1 addition & 1 deletion src/core-react/nft/hooks/useMintData.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useEffect, useState } from 'react';
import { useAccount } from 'wagmi';
import { convertIpfsToHttps } from '../../../core/nft/utils/ipfs';
import { useNFTLifecycleContext } from '../providers/NFTLifecycleProvider';
import type { NFTData, NFTError } from '../types';
import { convertIpfsToHttps } from '../../../core/nft/utils/ipfs';
import { useMintDetails } from './useMintDetails';

export function useMintData(
Expand Down
6 changes: 3 additions & 3 deletions src/core-react/nft/hooks/useMintDetails.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { renderHook, waitFor } from '@testing-library/react';
import { type Mock, beforeEach, describe, expect, it, vi } from 'vitest';
import { getMintDetails } from '../../core/api/getMintDetails';
import { getNewReactQueryTestProvider } from '../../identity/hooks/getNewReactQueryTestProvider';
import { getMintDetails } from '../../../core/api/getMintDetails';
import { getNewReactQueryTestProvider } from '../../../identity/hooks/getNewReactQueryTestProvider';
import { useMintDetails } from './useMintDetails';

vi.mock('../../core/api/getMintDetails');
vi.mock('../../../core/api/getMintDetails');

describe('useMintDetails', () => {
beforeEach(() => {
Expand Down
5 changes: 4 additions & 1 deletion src/core-react/nft/hooks/useMintDetails.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { type UseQueryResult, useQuery } from '@tanstack/react-query';
import { getMintDetails } from '../../../core/api/getMintDetails';
import type { GetMintDetailsParams, MintDetails } from '../../../core/api/types';
import type {
GetMintDetailsParams,
MintDetails,
} from '../../../core/api/types';
import { isNFTError } from '../../../core/nft/utils/isNFTError';

export function useMintDetails({
Expand Down
4 changes: 2 additions & 2 deletions src/core-react/nft/hooks/useNFTData.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import {
it,
vi,
} from 'vitest';
import { useNFTLifecycleContext } from '../components/NFTLifecycleProvider';
import { useNFTLifecycleContext } from '../providers/NFTLifecycleProvider';
import { useNFTData } from './useNFTData';
import { useTokenDetails } from './useTokenDetails';

vi.mock('./useTokenDetails');
vi.mock('../components/NFTLifecycleProvider');
vi.mock('../providers/NFTLifecycleProvider');

describe('useNFTData', () => {
const mockUpdateLifecycleStatus = vi.fn();
Expand Down
2 changes: 1 addition & 1 deletion src/core-react/nft/hooks/useNFTData.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useState } from 'react';
import { convertIpfsToHttps } from '../../../core/nft/utils/ipfs';
import { useNFTLifecycleContext } from '../providers/NFTLifecycleProvider';
import type { ContractType, NFTData, NFTError } from '../types';
import { convertIpfsToHttps } from '../../../core/nft/utils/ipfs';
import { useTokenDetails } from './useTokenDetails';

export function useNFTData(
Expand Down
6 changes: 3 additions & 3 deletions src/core-react/nft/hooks/useTokenDetails.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { renderHook, waitFor } from '@testing-library/react';
import { type Mock, beforeEach, describe, expect, it, vi } from 'vitest';
import { getTokenDetails } from '../../core/api/getTokenDetails';
import { getNewReactQueryTestProvider } from '../../identity/hooks/getNewReactQueryTestProvider';
import { getTokenDetails } from '../../../core/api/getTokenDetails';
import { getNewReactQueryTestProvider } from '../../../identity/hooks/getNewReactQueryTestProvider';
import { useTokenDetails } from './useTokenDetails';

vi.mock('../../core/api/getTokenDetails');
vi.mock('../../../core/api/getTokenDetails');

describe('useTokenDetails', () => {
beforeEach(() => {
Expand Down
5 changes: 4 additions & 1 deletion src/core-react/nft/hooks/useTokenDetails.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { type UseQueryResult, useQuery } from '@tanstack/react-query';
import { getTokenDetails } from '../../../core/api/getTokenDetails';
import type { GetTokenDetailsParams, TokenDetails } from '../../../core/api/types';
import type {
GetTokenDetailsParams,
TokenDetails,
} from '../../../core/api/types';
import { isNFTError } from '../../../core/nft/utils/isNFTError';

export function useTokenDetails({
Expand Down
2 changes: 1 addition & 1 deletion src/core/nft/utils/buildMintTransactionData.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type Mock, describe, expect, it, vi } from 'vitest';
import { buildMintTransaction as buildMintTransationApi } from '../../api/buildMintTransaction';
import { buildMintTransactionData } from './buildMintTransactionData';

vi.mock('../../core/api/buildMintTransaction');
vi.mock('../../api/buildMintTransaction');

describe('buildMintTransactionData', () => {
const mockBuildMintTransaction = buildMintTransationApi as Mock;
Expand Down
2 changes: 1 addition & 1 deletion src/core/nft/utils/buildMintTransactionData.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Address } from 'viem';
import type { Call } from '../../../transaction/types';
import { buildMintTransaction as buildMintTransactionApi } from '../../api/buildMintTransaction';
import type { BuildMintTransactionParams } from '../../api/types';
import type { Call } from '../../../transaction/types';

async function getMintTransaction({
mintAddress,
Expand Down
14 changes: 13 additions & 1 deletion src/ui/react/nft/NFTCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,30 @@ import {
vi,
} from 'vitest';
import { useAccount } from 'wagmi';
<<<<<<< HEAD
import { useIsMounted } from '../../core-react/internal/hooks/useIsMounted';
=======
import { NFTProvider } from '../../../core-react/nft/providers/NFTProvider';
import { useIsMounted } from '../../../useIsMounted';
>>>>>>> 38ec07ca (fix: lint/tests)
import { NFTCard } from './NFTCard';
import { NFTProvider } from './NFTProvider';

vi.mock('wagmi', () => ({
useAccount: vi.fn(),
}));
<<<<<<< HEAD
vi.mock('../../core-react/internal/hooks/useTheme', () => ({
useTheme: vi.fn(() => 'default-light'),
}));
vi.mock('../../core-react/internal/hooks/useIsMounted');
vi.mock('./NFTProvider', () => ({
=======
vi.mock('../../../useTheme', () => ({
useTheme: vi.fn(() => 'default-light'),
}));
vi.mock('../../../useIsMounted');
vi.mock('../../../core-react/nft/providers/NFTProvider', () => ({
>>>>>>> 38ec07ca (fix: lint/tests)
NFTProvider: vi.fn(({ children }) => <div>{children}</div>),
}));

Expand Down
2 changes: 0 additions & 2 deletions src/ui/react/nft/NFTCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { useNFTData as defaultUseNFTData } from '../../../core-react/nft/hooks/u
import { LifecycleType, type NFTCardReact } from '../../../core-react/nft/types';
import NFTErrorBoundary from './NFTErrorBoundary';
import { NFTErrorFallback } from './NFTErrorFallback';
import { NFTLifecycleProvider } from '../../../core-react/nft/providers/NFTLifecycleProvider';
import { NFTProvider } from '../../../core-react/nft/providers/NFTProvider';

export function NFTCard({
children,
Expand Down
11 changes: 11 additions & 0 deletions src/ui/react/nft/NFTMintCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
it,
vi,
} from 'vitest';
<<<<<<< HEAD
import { useIsMounted } from '../../core-react/internal/hooks/useIsMounted';
import { NFTMintCard } from './NFTMintCard';

Expand All @@ -17,6 +18,16 @@ vi.mock('../../core-react/internal/hooks/useTheme', () => ({
}));
vi.mock('../../core-react/internal/hooks/useIsMounted');
vi.mock('./NFTProvider', () => ({
=======
import { useIsMounted } from '../../../useIsMounted';
import { NFTMintCard } from './NFTMintCard';

vi.mock('../../../useTheme', () => ({
useTheme: vi.fn(() => 'default-light'),
}));
vi.mock('../../../useIsMounted');
vi.mock('../../../core-react/nft/providers/NFTProvider', () => ({
>>>>>>> 38ec07ca (fix: lint/tests)
NFTProvider: vi.fn(({ children }) => <div>{children}</div>),
}));

Expand Down
105 changes: 0 additions & 105 deletions src/ui/react/nft/components/view/NFTAudio.tsx

This file was deleted.

97 changes: 0 additions & 97 deletions src/ui/react/nft/components/view/NFTImage.tsx

This file was deleted.

Loading

0 comments on commit bea62e2

Please sign in to comment.