cypress-components/cypress/e2e/todolist.cy.js
2025-07-10 14:49:32 +02:00

16 lines
No EOL
581 B
JavaScript

describe('template spec', () => {
beforeEach(() => {
cy.visit('./../todolist.html')
})
it("Ajoute 4 todos puis supprime la 2ème, il doit en rester 3", () => {
const todos = ["Test 1", "Test 2", "Test 3", "Test 4"];
todos.forEach(todo => {
cy.get('input[placeholder="What needs to be done?"]').type(todo)
cy.get('button[type="submit"]').click()
})
cy.contains('Test 2').parent().find('button').click()
cy.get('.flex.items-center.justify-between').should('have.length', 3)
cy.contains('Nombre de tâche(s) : 3').should('exist')
})
})