2024-08-05 13:42:57 +00:00
|
|
|
describe('EntryStockBought', () => {
|
|
|
|
const reserveField = 'input[name="reserve"]';
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.viewport(1920, 1080);
|
|
|
|
cy.login('buyer');
|
|
|
|
cy.visit(
|
|
|
|
`/#/entry/stock-Bought?table={"filter":"{}","dated":"2000-12-31T23:00:00.000Z"}`
|
|
|
|
);
|
|
|
|
});
|
|
|
|
it('Should edit the reserved space', () => {
|
2024-09-04 12:40:36 +00:00
|
|
|
cy.get('tBody > tr').its('length').should('eq', 2);
|
2024-08-05 13:42:57 +00:00
|
|
|
cy.get(reserveField).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');
|
2024-09-11 05:55:12 +00:00
|
|
|
cy.get('tBody > tr').its('length').should('eq', 3);
|
2024-08-05 13:42:57 +00:00
|
|
|
});
|
|
|
|
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'
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|