diff --git a/test/cypress/integration/worker/workerManagement.spec.js b/test/cypress/integration/worker/workerManagement.spec.js index 4615c6b7d..590dfe6d2 100644 --- a/test/cypress/integration/worker/workerManagement.spec.js +++ b/test/cypress/integration/worker/workerManagement.spec.js @@ -1,22 +1,17 @@ describe('WorkerList', () => { const nif = '12091201A'; - const name = 'developer'; const searchButton = '.q-scrollarea__content > .q-btn--standard > .q-btn__content'; - beforeEach(() => { - cy.viewport(1280, 720); - cy.login('developer'); - cy.visit('/#/worker/management'); - cy.typeSearchbar('{enter}'); + const url = '/#/worker/management'; + + it('should not enter the section', () => { + cy.login('salesPerson'); + cy.visit(url); + cy.url().should('include', '/dashboard'); }); - it('should filter and show only two results', () => { - cy.get( - '[label="First name"] > .q-field > .q-field__inner > .q-field__control', - ).type(`${name}{enter}`); - cy.validateVnTableRows(2); - }); - - it('should filter by NIF and open the worker summary popup', () => { + it('should enter the section and filter by NIF, then open the worker summary popup', () => { + cy.login('hr'); + cy.visit(url); cy.get('[label="NIF"] > .q-field > .q-field__inner > .q-field__control').type( nif, );