31 lines
1.1 KiB
JavaScript
31 lines
1.1 KiB
JavaScript
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}');
|
|
});
|
|
|
|
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', () => {
|
|
cy.get('[label="NIF"] > .q-field > .q-field__inner > .q-field__control').type(
|
|
nif,
|
|
);
|
|
cy.get(searchButton).click();
|
|
cy.dataCy('tableAction-0').click();
|
|
cy.get('.summaryHeader').should('exist');
|
|
cy.get('.summaryHeader').should('be.visible');
|
|
cy.get('.summaryBody').should('exist');
|
|
cy.get('.summaryBody').should('be.visible');
|
|
});
|
|
});
|