forked from verdnatura/salix-front
chore: refs #7663 add test
This commit is contained in:
parent
b13874e8a1
commit
6f98f24926
|
@ -5,15 +5,14 @@ describe('Ticket descriptor', () => {
|
|||
const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span';
|
||||
const summaryHeader = '.summaryHeader > div';
|
||||
const weight = 25;
|
||||
const ticketId = 1;
|
||||
|
||||
const weightValue = ':nth-child(10) > .value > span';
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/ticket/${ticketId}/summary`);
|
||||
cy.viewport(1920, 1080);
|
||||
});
|
||||
|
||||
it('should clone the ticket without warehouse', () => {
|
||||
cy.openLeftMenu();
|
||||
cy.visit('/#/ticket/1/summary');
|
||||
cy.openActionsDescriptor();
|
||||
cy.get(toCloneOpt).click();
|
||||
cy.clickConfirm();
|
||||
|
@ -27,19 +26,13 @@ describe('Ticket descriptor', () => {
|
|||
});
|
||||
|
||||
it('should set the weight of the ticket', () => {
|
||||
cy.openLeftMenu();
|
||||
cy.visit('/#/ticket/10/summary');
|
||||
cy.openActionsDescriptor();
|
||||
cy.get(setWeightOpt).click();
|
||||
cy.get('.q-dialog input').type(25);
|
||||
cy.intercept('POST', /\/api\/Tickets\/\d+\/setWeight/).as('weight');
|
||||
cy.get('.q-dialog input').type(weight);
|
||||
cy.clickConfirm();
|
||||
|
||||
cy.get('.q-notification').should('contain', 'Peso establecido');
|
||||
|
||||
cy.intercept('POST', /\/api\/Tickets\/\d+/).as('worker');
|
||||
cy.wait('@worker').then(() =>
|
||||
cy.get(descriptorTitle).should('include.text', 'Jessica')
|
||||
);
|
||||
|
||||
cy.get('@fetchSpy').should('have.been.called');
|
||||
cy.wait('@weight');
|
||||
cy.get(weightValue).contains(weight);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue