Skip to content

Commit

Permalink
💚 Fix Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0x46616c6b committed Jan 2, 2025
1 parent dab1ad8 commit fed1542
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
import { FC } from 'react'
import { BrowserRouter, Route, Routes } from 'react-router-dom'
import { BrowserRouter, Route, Routes } from 'react-router'
import '../leaflet.config.js'
import Notification from './components/Notification.js'
import ProtectedRoute from './components/ProtectedRoute'
Expand Down
2 changes: 1 addition & 1 deletion src/components/navigation/NavItem.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Button, colors } from '@mui/material'
import { FC } from 'react'
import { Link } from 'react-router-dom'
import { Link } from 'react-router'

interface Props {
active: boolean
Expand Down
2 changes: 1 addition & 1 deletion src/components/ticker/TickerList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Table, TableCell, TableContainer, TableHead, TableRow, TableSortLabel } from '@mui/material'
import { FC, useEffect, useState } from 'react'
import { useSearchParams } from 'react-router-dom'
import { useSearchParams } from 'react-router'
import { GetTickersQueryParams } from '../../api/Ticker'
import useDebounce from '../../hooks/useDebounce'
import TickerListFilter from './TickerListFilter'
Expand Down
8 changes: 4 additions & 4 deletions src/contexts/AuthContext.test.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { describe, it, expect, beforeEach, vi } from 'vitest'
import { render, screen } from '@testing-library/react'
import { AuthProvider } from './AuthContext'
import { MemoryRouter } from 'react-router-dom'
import sign from 'jwt-encode'
import { MemoryRouter } from 'react-router-dom'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { AuthProvider } from './AuthContext'

// Mock of useNavigate, useLocation (react-router-dom)
// Mock of useNavigate, useLocation (react-router)
vi.mock('react-router', () => ({
...vi.importActual('react-router'), // This ensures any other exports remain intact
useNavigate: vi.fn(() => vi.fn()), // A function that returns another function
Expand Down
3 changes: 1 addition & 2 deletions src/views/HomeView.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { FC } from 'react'
import { Navigate } from 'react-router'
import { useSearchParams } from 'react-router-dom'
import { Navigate, useSearchParams } from 'react-router'
import Loader from '../components/Loader'
import useAuth from '../contexts/useAuth'
import useTickersQuery from '../queries/useTickersQuery'
Expand Down
8 changes: 4 additions & 4 deletions src/views/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { FC } from 'react'
import { faGaugeHigh, faGears, faUsers } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { Box, Container } from '@mui/material'
import { FC } from 'react'
import { useLocation } from 'react-router'
import Nav from '../components/navigation/Nav'
import NavItem from '../components/navigation/NavItem'
import UserDropdown from '../components/navigation/UserDropdown'
import useAuth from '../contexts/useAuth'
import { useLocation } from 'react-router-dom'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faGaugeHigh, faGears, faUsers } from '@fortawesome/free-solid-svg-icons'

interface Props {
children: React.ReactNode
Expand Down
2 changes: 1 addition & 1 deletion src/views/TickerView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FC } from 'react'
import { useParams } from 'react-router-dom'
import { useParams } from 'react-router'
import Ticker from '../components/ticker/Ticker'
import useAuth from '../contexts/useAuth'
import useTickerQuery from '../queries/useTickerQuery'
Expand Down

0 comments on commit fed1542

Please sign in to comment.