describe('WorkerList', () => {
    const inputName = '.q-drawer .q-form input[aria-label="First Name"]';
    const searchBtn = '.q-drawer button:nth-child(3)';
    const descriptorTitle = '.descriptor .title span';
    beforeEach(() => {
        cy.viewport(1280, 720);
        cy.login('developer');
        cy.visit('/#/worker/list');
    });

    it('should open the worker summary', () => {
        cy.get(inputName).type('jessica{enter}');
        cy.get(searchBtn).click();
        cy.intercept('GET', /\/api\/Workers\/\d+/).as('worker');
        cy.wait('@worker').then(() =>
            cy.get(descriptorTitle).should('include.text', 'Jessica')
        );
    });
});
