From 631388cd15ea7c6ddad2fac87babf96c16e2b212 Mon Sep 17 00:00:00 2001 From: Cleopatra Enjeck M Date: Tue, 2 Jan 2024 07:27:00 +0100 Subject: [PATCH] test: add e2e test for row Signed-off-by: Cleopatra Enjeck M --- cypress/e2e/tables-rows.cy.js | 27 +++++++++++++++++++++++++++ src/modules/modals/CreateRow.vue | 4 ++-- src/modules/modals/EditRow.vue | 3 ++- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/tables-rows.cy.js b/cypress/e2e/tables-rows.cy.js index 9f9f3613e..95dc372f9 100644 --- a/cypress/e2e/tables-rows.cy.js +++ b/cypress/e2e/tables-rows.cy.js @@ -47,4 +47,31 @@ describe('Rows for a table', () => { cy.get('.modal-container:visible').should('not.exist') cy.get('.custom-table table').contains('Changed column value').should('not.exist') }) + + it('Check mandatory fields error', () => { + cy.contains('.app-menu-entry--label', 'Tables').click() + cy.contains('button', 'Create new table').click() + cy.get('.tile').contains('ToDo').click({ force: true }) + cy.get('.modal__content').should('be.visible') + cy.get('.modal__content input[type="text"]').clear().type('to do list') + cy.contains('button', 'Create table').click() + + cy.get('.app-navigation-entry-link').contains('to do list').click({ force: true }) + cy.get('.NcTable').contains('Create row').click({ force: true }) + + cy.get('[data-cy="createRowModal"] .notecard--error').should('exist') + cy.get('[data-cy="createRowSaveButton"]').should('be.disabled') + cy.get('.modal__content .slot input').first().type('My first task') + cy.get('[data-cy="createRowModal"] .notecard--error').should('not.exist') + cy.get('[data-cy="createRowSaveButton"]').should('be.enabled') + cy.get('[data-cy="createRowSaveButton"]').click() + + cy.get('.app-navigation-entry-link').contains('to do list').click({ force: true }) + cy.get('.custom-table table').contains('My first task').parent().parent().find('[aria-label="Edit row"]').click() + cy.get('[data-cy="editRowModal"] .notecard--error').should('not.exist') + cy.get('.modal__content .slot input').first().clear() + cy.get('[data-cy="editRowModal"] .notecard--error').should('exist') + cy.get('[data-cy="editRowSaveButton"]').should('be.disabled') + + }) }) diff --git a/src/modules/modals/CreateRow.vue b/src/modules/modals/CreateRow.vue index 1e17f815e..db75f549c 100644 --- a/src/modules/modals/CreateRow.vue +++ b/src/modules/modals/CreateRow.vue @@ -1,5 +1,5 @@