✅ test: fix failing unit tests

This commit is contained in:
2026-02-09 16:16:29 +01:00
parent ef00d37351
commit 527203c635
17 changed files with 104 additions and 280 deletions
+2 -9
View File
@@ -1,20 +1,13 @@
import { render, screen } from '@testing-library/react'
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { useAnalytics } from 'use-analytics'
import App from './App'
// Mock the analytics module
vi.mock('use-analytics', () => ({
useAnalytics: () => ({ plugins: { enable: vi.fn(), disable: vi.fn() }, page: vi.fn() }),
}))
import App from './App.js'
describe('App component', () => {
test('renders MainPage without crashing', async () => {
render(<App />)
expect(screen.getByLabelText('loading-screen')).toBeInTheDocument()
expect(await screen.findByText('Robotics Engineer')).toBeInTheDocument()
expect(await screen.findByText("Compagnia d'Arme del Santo Luca")).toBeInTheDocument()
expect(screen.queryByLabelText('loading-screen')).not.toBeInTheDocument()
})
})