2024-03-15 15:30:12 +00:00
|
|
|
/// <reference types="cypress" />
|
|
|
|
describe('Ticket descriptor', () => {
|
2024-05-13 15:07:59 +00:00
|
|
|
const toCloneOpt = '[role="menu"] .q-list > :nth-child(5)';
|
2024-03-28 08:46:18 +00:00
|
|
|
const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span';
|
2024-03-15 15:30:12 +00:00
|
|
|
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();
|
2024-08-27 08:27:51 +00:00
|
|
|
cy.get(warehouseValue).contains('Warehouse One');
|
2024-03-15 15:30:12 +00:00
|
|
|
cy.get(summaryHeader)
|
|
|
|
.invoke('text')
|
|
|
|
.then((text) => {
|
|
|
|
const [, owner] = text.split('-');
|
|
|
|
cy.wrap(owner.trim()).should('eq', 'Bruce Wayne (1101)');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|