Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Unidad #56

Open
Esteban14b opened this issue May 18, 2019 · 0 comments
Open

Test Unidad #56

Esteban14b opened this issue May 18, 2019 · 0 comments

Comments

@Esteban14b
Copy link

Hola, como están profes? quería consultarles si esta bien resulto el siguiente ejercicio Test de Unidad.

Ejer 1) Hacer un test que pruebe que el modelo de películas permite eliminar una película.
test("Eliminar pelicula" ,  async () =>{
    const movieData = {
        title: 'El dia que me quieras',
        description: 'Carlos Argüelles is the son of a wealthy man whose only interests in life are business and making money. While trying to succeed in show business he falls in love with a dancer and they elope to marry. But success is not easy to obtain.',
        year: 1935,
        runtime: 82,
        country: 'United States',
        language: 'Spanish',
        genres: ['Drama'],
        directors: ['John Reinhardt'],
        writers: ['Alfredo Le Pera']
    };    
    //Insertamos pelicula
    const movieCreated = await MovieModels.create(movieData);
    //Borrar pelicula recien insertada por id
    await MovieModels.delete(movieCreated.id);
    //Buscar pelicula recien insertada por id
    const recivedMovie = await MovieModels.get(movieCreated.id);
    //Se fija que la pelicula se haya eliminado
    expect(recivedMovie).toBe(null);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant