forked from verdnatura/salix-front
28 lines
880 B
JavaScript
28 lines
880 B
JavaScript
|
/// <reference types="cypress" />
|
||
|
describe('Ticket descriptor', () => {
|
||
|
const toCloneOpt = '.q-list > :nth-child(5)';
|
||
|
const warehouseValue = '.summaryBody > :nth-child(2) > :nth-child(6) > .value > span';
|
||
|
const summaryHeader = '.summaryHeader > div';
|
||
|
|
||
|
beforeEach(() => {
|
||
|
const ticketId = 1;
|
||
|
|
||
|
cy.login('developer');
|
||
|
cy.visit(`/#/ticket/${ticketId}/summary`);
|
||
|
});
|
||
|
|
||
|
it('should clone the ticket without warehouse', () => {
|
||
|
cy.openLeftMenu();
|
||
|
cy.openActionsDescriptor();
|
||
|
cy.get(toCloneOpt).click();
|
||
|
cy.clickConfirm();
|
||
|
cy.get(warehouseValue).contains('-');
|
||
|
cy.get(summaryHeader)
|
||
|
.invoke('text')
|
||
|
.then((text) => {
|
||
|
const [, owner] = text.split('-');
|
||
|
cy.wrap(owner.trim()).should('eq', 'Bruce Wayne (1101)');
|
||
|
});
|
||
|
});
|
||
|
});
|