/// <reference types="cypress" />
describe('InvoiceInDueDay', () => {
    const inputs = 'label input';
    const inputBtns = 'label button';
    const addBtn = '.q-page-sticky > div > .q-btn > .q-btn__content';

    beforeEach(() => {
        cy.login('developer');
        cy.visit(`/#/invoice-in/6/due-day`);
    });

    it('should update the amount', () => {
        cy.get(inputBtns).eq(1).click();
        cy.get(inputs).eq(3).type(23);
        cy.saveCard();
        cy.get('.q-notification__message').should('have.text', 'Data saved');
    });

    it('should remove the first line', () => {
        cy.removeRow(1);
    });

    it('should add a new row ', () => {
        cy.waitForElement('thead');
        cy.get(addBtn).click();

        cy.saveCard();
        cy.get('.q-notification__message').should('have.text', 'Data saved');
    });
});
