fix: move CartSnackbar inside BrowserRouter in App.tsx
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { BrowserRouter } from 'react-router-dom'
|
||||
import { AppProviders } from '@/app/providers/AppProviders'
|
||||
import { AppRoutes } from '@/app/routes'
|
||||
import { CartSnackbar } from '@/shared/ui/CartSnackbar'
|
||||
import { ErrorBoundary } from '@/shared/ui/ErrorBoundary'
|
||||
|
||||
export function App() {
|
||||
@@ -10,6 +11,7 @@ export function App() {
|
||||
<ErrorBoundary>
|
||||
<AppRoutes />
|
||||
</ErrorBoundary>
|
||||
<CartSnackbar />
|
||||
</BrowserRouter>
|
||||
</AppProviders>
|
||||
)
|
||||
|
||||
@@ -3,7 +3,6 @@ import CssBaseline from '@mui/material/CssBaseline'
|
||||
import { ThemeProvider, createTheme } from '@mui/material/styles'
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { ThemeControllerProvider, useThemeController } from '@/app/providers/theme-controller'
|
||||
import { CartSnackbar } from '@/shared/ui/CartSnackbar'
|
||||
import { SseProvider } from './SseProvider'
|
||||
|
||||
function AppThemeInner({ children }: PropsWithChildren) {
|
||||
@@ -189,10 +188,7 @@ export function AppProviders({ children }: PropsWithChildren) {
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<SseProvider />
|
||||
<ThemeControllerProvider>
|
||||
<AppThemeInner>
|
||||
{children}
|
||||
<CartSnackbar />
|
||||
</AppThemeInner>
|
||||
<AppThemeInner>{children}</AppThemeInner>
|
||||
</ThemeControllerProvider>
|
||||
</QueryClientProvider>
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { render, screen, fireEvent } from '@testing-library/react'
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import * as notifications from '@/shared/model/cart-notifications'
|
||||
import { AddToCartButton } from '../AddToCartButton'
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { render, screen, fireEvent } from '@testing-library/react'
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { render, screen, fireEvent } from '@testing-library/react'
|
||||
import { MemoryRouter } from 'react-router-dom'
|
||||
import * as notifications from '@/shared/model/cart-notifications'
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import * as api from '@/entities/cart/api/cart-api'
|
||||
import * as notifications from '@/shared/model/cart-notifications'
|
||||
import { ToggleCartIcon } from '../ToggleCartIcon'
|
||||
|
||||
vi.mock('@/entities/cart/api/cart-api', () => ({
|
||||
|
||||
Reference in New Issue
Block a user