fix(web/tests): eliminar imports no usados en tests (TS6133)
This commit is contained in:
@@ -5,42 +5,10 @@ import { useAuthStore } from '../../../stores/authStore'
|
||||
import { ProtectedRoute } from '../../../components/routing/ProtectedRoute'
|
||||
|
||||
// Helper components for testing
|
||||
function HomePage() {
|
||||
return <div>Home Page</div>
|
||||
}
|
||||
|
||||
function SecurePage() {
|
||||
return <div>Secure Page</div>
|
||||
}
|
||||
|
||||
// Renders ProtectedRoute at a given path with optional navigation target capture
|
||||
function renderProtected(
|
||||
props: {
|
||||
requiredRoles?: string[]
|
||||
requiredPermissions?: string[]
|
||||
children?: React.ReactNode
|
||||
},
|
||||
{ initialPath = '/' }: { initialPath?: string } = {},
|
||||
) {
|
||||
const { children, ...routeProps } = props
|
||||
return render(
|
||||
<MemoryRouter initialEntries={[initialPath]}>
|
||||
<Routes>
|
||||
<Route path="/login" element={<div>Login Page</div>} />
|
||||
<Route path="/" element={<div>Root</div>} />
|
||||
<Route
|
||||
path="/secure"
|
||||
element={
|
||||
<ProtectedRoute {...routeProps}>
|
||||
{children ?? <SecurePage />}
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
</Routes>
|
||||
</MemoryRouter>,
|
||||
)
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
useAuthStore.setState({ user: null, accessToken: null, refreshToken: null, expiresAt: null })
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// T600.5 — TDD: TipoDeIvaFormModal
|
||||
// CRÍTICO: verifica que el modal de Editar NO tiene campo Porcentaje [REQ-UI-003]
|
||||
import { describe, it, expect, beforeAll, afterAll, afterEach, vi } from 'vitest'
|
||||
import { describe, it, expect, vi } from 'vitest'
|
||||
import { render, screen, waitFor } from '@testing-library/react'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect, beforeAll, afterAll, afterEach, vi } from 'vitest'
|
||||
import { describe, it, expect, vi } from 'vitest'
|
||||
import { render, screen, waitFor } from '@testing-library/react'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { describe, it, expect, beforeAll, afterAll, afterEach, vi } from 'vitest'
|
||||
import { render, screen, waitFor } from '@testing-library/react'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
import { http, HttpResponse } from 'msw'
|
||||
import { setupServer } from 'msw/node'
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, it, expect, beforeAll, afterAll, afterEach, vi } from 'vitest'
|
||||
import { render, screen, waitFor, within } from '@testing-library/react'
|
||||
import { render, screen, waitFor } from '@testing-library/react'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
import { http, HttpResponse } from 'msw'
|
||||
import { setupServer } from 'msw/node'
|
||||
|
||||
Reference in New Issue
Block a user