|
|
|
|
@ -151,13 +151,19 @@ test.describe('Página de música', () => {
|
|
|
|
|
await expect(valoracion.getByRole('heading')).toHaveCount(0);
|
|
|
|
|
await expect(valoracion).not.toContainText(/valoración|de 5|votos?|quitar mi voto/i);
|
|
|
|
|
|
|
|
|
|
const numeroValoracion = valoracion.locator('.media');
|
|
|
|
|
const estrellas = await valoracion.locator('.estrellas').boundingBox();
|
|
|
|
|
const puntuacion = await valoracion.locator('.media').boundingBox();
|
|
|
|
|
const puntuacion = await numeroValoracion.boundingBox();
|
|
|
|
|
expect(estrellas).not.toBeNull();
|
|
|
|
|
expect(puntuacion).not.toBeNull();
|
|
|
|
|
const centroEstrellas = (estrellas?.y ?? 0) + (estrellas?.height ?? 0) / 2;
|
|
|
|
|
const centroPuntuacion = (puntuacion?.y ?? 0) + (puntuacion?.height ?? 0) / 2;
|
|
|
|
|
expect(Math.abs(centroEstrellas - centroPuntuacion)).toBeLessThan(2);
|
|
|
|
|
const familiaNumero = await numeroValoracion.evaluate(
|
|
|
|
|
(elemento) => getComputedStyle(elemento).fontFamily
|
|
|
|
|
);
|
|
|
|
|
expect(familiaNumero).toContain('Archivo');
|
|
|
|
|
expect(familiaNumero).not.toContain('Newsreader');
|
|
|
|
|
|
|
|
|
|
const favorito = cabecera.getByRole('link', { name: /añadir a favoritos/i });
|
|
|
|
|
const lista = cabecera.getByRole('link', { name: /añadir a una lista de reproducción/i });
|
|
|
|
|
|