Skip to content

Commit

Permalink
Arreglo test Ayuda
Browse files Browse the repository at this point in the history
  • Loading branch information
Verzidee committed Apr 24, 2024
1 parent 756000b commit 908a651
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions webapp/src/components/pages/Ayuda.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 908a651

Please sign in to comment.