generated from Arquisoft/wiq_0
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,34 +17,36 @@ describe('Help Tests', () => { | |
mockNavigate.mockClear(); | ||
}); | ||
|
||
test('renders Help', () => { | ||
test('renders Help', async () => { | ||
render( | ||
<BrowserRouter> | ||
<Ayuda /> | ||
</BrowserRouter> | ||
); | ||
|
||
// Verifica que estan los elementos | ||
expect(screen.getByText(/AYUDA (WIQ 4D)/i)).toBeInTheDocument(); | ||
|
||
// verifica las secciones | ||
expect(screen.getByText(/Registro e Inicio de Sesión/i)).toBeInTheDocument(); | ||
expect(screen.getByText(/Cómo Jugar/i)).toBeInTheDocument(); | ||
expect(screen.getByText(/Historial y Ranking/i)).toBeInTheDocument(); | ||
expect(screen.getByText(/API REST de la aplicación/i)).toBeInTheDocument(); | ||
expect(screen.getByText(/Otras Funcionalidades/i)).toBeInTheDocument(); | ||
expect(screen.getByText(/Contacto/i)).toBeInTheDocument(); | ||
|
||
// verifica el video | ||
expect(screen.getByTestId('help-video')).toHaveAttribute('src', '/videos/help.mp4'); | ||
|
||
// verifica los links | ||
expect(screen.getByText('[email protected]')).toBeInTheDocument(); | ||
expect(screen.getByText('[email protected]')).toBeInTheDocument(); | ||
expect(screen.getByText('[email protected]')).toBeInTheDocument(); | ||
// Utiliza findByText para esperar de forma asíncrona a que el texto esté disponible | ||
const ayudaTitle = await screen.findByText(/AYUDA \(WIQ 4D\)/i); | ||
expect(ayudaTitle).toBeInTheDocument(); | ||
|
||
// Verifica las secciones | ||
expect(await screen.findByText(/Registro e Inicio de Sesión/i)).toBeInTheDocument(); | ||
expect(await screen.findByText(/Cómo Jugar/i)).toBeInTheDocument(); | ||
expect(await screen.findByText(/Historial y Ranking/i)).toBeInTheDocument(); | ||
expect(await screen.findByText(/API REST de la aplicación/i)).toBeInTheDocument(); | ||
expect(await screen.findByText(/Otras Funcionalidades/i)).toBeInTheDocument(); | ||
expect(await screen.findByText(/Contacto/i)).toBeInTheDocument(); | ||
|
||
// Verifica el video | ||
expect(screen.getByTestId('help-video')).toHaveAttribute('src', '/videos/help.mp4'); | ||
|
||
// Verifica los links | ||
expect(await screen.findByText('[email protected]')).toBeInTheDocument(); | ||
expect(await screen.findByText('[email protected]')).toBeInTheDocument(); | ||
expect(await screen.findByText('[email protected]')).toBeInTheDocument(); | ||
}); | ||
|
||
|
||
|
||
}); | ||
|
||
async function wait(milliseconds) { | ||
|