describe('EntryStockBought', () => {
    beforeEach(() => {
        cy.viewport(1920, 1080);
        cy.login('buyer');
        cy.visit(`/#/entry/stock-Bought`);
    });
    it('Should edit the reserved space', () => {
        cy.get('.q-field__native.q-placeholder').should('have.value', '01/01/2001');
        cy.get('input[name="reserve"]').type('10{enter}');
        cy.get('button[title="Save"]').click();
        cy.get('.q-notification__message').should('have.text', 'Data saved');
    });
    it('Should add a new reserved space for buyerBoss', () => {
        cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
        cy.get('input[aria-label="Reserve"]').type('1');
        cy.get('input[aria-label="Date"]').eq(1).clear();
        cy.get('input[aria-label="Date"]').eq(1).type('01-01');
        cy.get('input[aria-label="Buyer"]').type('buyerboss{downarrow}{enter}');
        cy.get('.q-notification__message').should('have.text', 'Data created');
    });
    it('Should check detail for the buyer', () => {
        cy.get(':nth-child(1) > .sticky > .q-btn > .q-btn__content > .q-icon').click();
        cy.get('tBody > tr').eq(1).its('length').should('eq', 1);
    });
    it('Should check detail for the buyerBoss and had no content', () => {
        cy.get(':nth-child(2) > .sticky > .q-btn > .q-btn__content > .q-icon').click();
        cy.get('.q-table__bottom.row.items-center.q-table__bottom--nodata').should(
            'have.text',
            'warningNo data available'
        );
    });
    it('Should edit travel m3 and refresh', () => {
        cy.get('.vn-row > div > .q-btn > .q-btn__content > .q-icon').click();
        cy.get('input[aria-label="m3"]').clear();
        cy.get('input[aria-label="m3"]').type('60');
        cy.get('.q-mt-lg > .q-btn--standard > .q-btn__content > .block').click();
        cy.get('.vn-row > div > :nth-child(2)').should('have.text', '60');
    });
});