From 2a7855f9e841e96deba4d062869766adcaac9716 Mon Sep 17 00:00:00 2001 From: Hammad1007 Date: Tue, 26 Dec 2023 13:28:19 +0500 Subject: [PATCH] Testing the code file --- notes-app/cypress/e2e/test1.spec.cy.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/notes-app/cypress/e2e/test1.spec.cy.js b/notes-app/cypress/e2e/test1.spec.cy.js index dbe5254..b494575 100644 --- a/notes-app/cypress/e2e/test1.spec.cy.js +++ b/notes-app/cypress/e2e/test1.spec.cy.js @@ -94,6 +94,23 @@ describe('Project: Notes-App', () => { cy.get('.note textarea').should('be.visible') }) }) + + context('Delete the note button', () => { + it('The button is visible', () => { + cy.get('.delete').should('be.visible') + }) + + it('The button is clickable', () => { + cy.get('.delete').should('be.visible').click() + }) + + it('The button when clicked deletes the note from the screen', () => { + cy.get('.note').its('length').then((initialNoteCount) => { + cy.get('.note:first-of-type .delete').click() + cy.get('.note').should('have.length', initialNoteCount - 1) + }) + }) + }) }) }) })