salix/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js

471 lines
20 KiB
JavaScript
Raw Normal View History

2019-09-06 09:43:15 +00:00
import selectors from '../../../helpers/selectors.js';
2020-01-26 23:48:00 +00:00
import getBrowser from '../../../helpers/puppeteer';
// #1632 [e2e] ticket.sale - Transferir líneas
xdescribe('Ticket Edit sale path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
2020-01-26 23:48:00 +00:00
await page.loginAndModule('salesPerson', 'ticket');
await page.accessToSearchResult(16);
await page.accessToSection('ticket.card.sale');
2018-11-07 07:38:09 +00:00
});
afterAll(async() => {
await browser.close();
});
2019-06-27 06:41:07 +00:00
it(`should click on the first sale claim icon to navigate over there`, async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.firstSaleClaimIcon);
await page.wait(selectors.claimBasicData.claimState);
const url = await page.parsedUrl();
2018-11-07 07:38:09 +00:00
expect(url.hash).toEqual('#!/claim/2/basic-data');
});
2019-06-27 06:41:07 +00:00
it('should navigate to the tickets index', async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
await page.wait(selectors.ticketsIndex.topbarSearch);
const url = await page.parsedUrl();
2018-11-07 07:38:09 +00:00
expect(url.hash).toEqual('#!/ticket/index');
});
2019-06-27 06:41:07 +00:00
it(`should search for a ticket and then navigate to it's sales`, async() => {
2020-04-08 09:24:40 +00:00
await page.accessToSearchResult(16);
await page.accessToSection('ticket.card.sale');
await page.waitForURL('/sale');
const url = await page.parsedUrl();
2018-11-07 07:38:09 +00:00
expect(url.hash).toContain('/sale');
2018-10-25 14:44:03 +00:00
});
2019-06-27 06:41:07 +00:00
it(`should check the zoomed image isn't present`, async() => {
2020-04-08 09:24:40 +00:00
const result = await page.countElement(selectors.ticketSales.firstSaleZoomedImage);
2018-11-07 07:38:09 +00:00
expect(result).toEqual(0);
2018-10-25 14:44:03 +00:00
});
2019-01-07 08:33:07 +00:00
it(`should click on the thumbnail image of the 1st sale and see the zoomed image`, async() => {
2020-04-08 09:24:40 +00:00
await page.clickIfVisible(selectors.ticketSales.firstSaleThumbnailImage);
const result = await page.countElement(selectors.ticketSales.firstSaleZoomedImage);
2018-11-07 07:38:09 +00:00
expect(result).toEqual(1);
});
2019-01-07 08:33:07 +00:00
it(`should click on the zoomed image to close it`, async() => {
2020-04-08 09:24:40 +00:00
await page.clickIfVisible(selectors.ticketSales.firstSaleZoomedImage);
const result = await page.countElement(selectors.ticketSales.firstSaleZoomedImage);
2018-11-07 07:38:09 +00:00
expect(result).toEqual(0);
});
2019-01-07 08:33:07 +00:00
it(`should confirm the item descriptor insnt visible yet`, async() => {
2020-04-08 09:24:40 +00:00
const visible = await page.isVisible(selectors.ticketSales.saleDescriptorPopover);
2018-11-07 07:38:09 +00:00
expect(visible).toBeFalsy();
});
2019-01-07 08:33:07 +00:00
it(`should click on the first sale ID making the item descriptor visible`, async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.firstSaleId);
await page.waitImgLoad(selectors.ticketSales.firstSaleDescriptorImage);
const visible = await page.isVisible(selectors.ticketSales.saleDescriptorPopover);
2018-11-07 07:38:09 +00:00
expect(visible).toBeTruthy();
});
2019-01-07 08:33:07 +00:00
it(`should click on the descriptor image of the 1st sale and see the zoomed image`, async() => {
2020-04-08 09:24:40 +00:00
await page.clickIfVisible('vn-item-descriptor img');
const result = await page.countElement(selectors.ticketSales.firstSaleZoomedImage);
2018-11-07 07:38:09 +00:00
expect(result).toEqual(1);
});
2019-02-04 14:40:57 +00:00
it(`should now click on the zoomed image to close it`, async() => {
2020-04-08 09:24:40 +00:00
await page.clickIfVisible(selectors.ticketSales.firstSaleZoomedImage);
const result = await page.countElement(selectors.ticketSales.firstSaleZoomedImage);
2018-11-07 07:38:09 +00:00
expect(result).toEqual(0);
});
2019-01-07 08:33:07 +00:00
it(`should click on the summary icon of the item-descriptor to access to the item summary`, async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.saleDescriptorPopoverSummaryButton);
await page.waitForURL('/summary');
const url = await page.parsedUrl();
2018-11-07 07:38:09 +00:00
expect(url.hash).toContain('/summary');
});
2019-01-07 08:33:07 +00:00
it('should return to ticket sales section', async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
await page.accessToSearchResult(16);
await page.accessToSection('ticket.card.sale');
await page.waitForURL('/sale');
const url = await page.parsedUrl();
2018-11-07 07:38:09 +00:00
expect(url.hash).toContain('/sale');
});
2019-01-07 08:33:07 +00:00
it('should try to add a higher quantity value and then receive an error', async() => {
2020-04-08 09:24:40 +00:00
await page.focusElement(selectors.ticketSales.firstSaleQuantityCell);
await page.write(selectors.ticketSales.firstSaleQuantity, '11\u000d');
const message = await page.waitForSnackbar();
2018-11-07 07:38:09 +00:00
2020-04-08 09:24:40 +00:00
expect(message.text).toBe('The new quantity should be smaller than the old one');
});
2019-06-27 06:41:07 +00:00
it('should remove 1 from the first sale quantity', async() => {
2020-04-08 09:24:40 +00:00
await page.focusElement(selectors.ticketSales.firstSaleQuantityCell);
await page.write(selectors.ticketSales.firstSaleQuantity, '9\u000d');
const message = await page.waitForSnackbar();
2018-11-07 07:38:09 +00:00
2020-04-08 09:24:40 +00:00
expect(message.type).toBe('success');
});
2019-01-07 08:33:07 +00:00
it('should update the price', async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(`${selectors.ticketSales.firstSalePrice} > span`);
await page.write(selectors.ticketSales.firstSalePriceInput, '5\u000d');
const message = await page.waitForSnackbar();
2018-11-07 07:38:09 +00:00
2020-04-08 09:24:40 +00:00
expect(message.type).toBe('success');
});
2019-01-07 08:33:07 +00:00
it('should confirm the price have been updated', async() => {
2020-04-08 09:24:40 +00:00
const result = await page.waitToGetProperty(`${selectors.ticketSales.firstSalePrice} span`, 'innerText');
2018-11-07 07:38:09 +00:00
expect(result).toContain('5.00');
});
2019-01-07 08:33:07 +00:00
it('should confirm the total price for that item have been updated', async() => {
2020-04-08 09:24:40 +00:00
const result = await page.waitToGetProperty(selectors.ticketSales.firstSaleImport, 'innerText');
2018-11-07 07:38:09 +00:00
2019-06-27 06:41:07 +00:00
expect(result).toContain('45.00');
});
2019-01-07 08:33:07 +00:00
it('should update the discount', async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(`${selectors.ticketSales.firstSaleDiscount} > span`);
await page.write(selectors.ticketSales.firstSaleDiscountInput, '50\u000d');
const message = await page.waitForSnackbar();
2018-11-07 07:38:09 +00:00
2020-04-08 09:24:40 +00:00
expect(message.type).toBe('success');
});
2019-01-07 08:33:07 +00:00
it('should confirm the discount have been updated', async() => {
2020-04-08 09:24:40 +00:00
await page.waitForTextInElement(`${selectors.ticketSales.firstSaleDiscount} > span`, '50.00%');
const result = await page.waitToGetProperty(`${selectors.ticketSales.firstSaleDiscount} > span`, 'innerText');
2018-11-07 07:38:09 +00:00
2020-01-16 12:39:32 +00:00
expect(result).toContain('50.00%');
2018-10-25 14:44:03 +00:00
});
2019-01-07 08:33:07 +00:00
it('should confirm the total import for that item have been updated', async() => {
2020-04-08 09:24:40 +00:00
await page.waitForTextInElement(selectors.ticketSales.firstSaleImport, '22.50');
const result = await page.waitToGetProperty(selectors.ticketSales.firstSaleImport, 'innerText');
2018-11-07 07:38:09 +00:00
2019-06-27 06:41:07 +00:00
expect(result).toContain('22.50');
2018-10-25 14:44:03 +00:00
});
2019-01-07 08:33:07 +00:00
it('should select the third sale and create a claim of it', async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox);
await page.waitToClick(selectors.ticketSales.moreMenu);
await page.waitToClick(selectors.ticketSales.moreMenuCreateClaim);
await page.wait(selectors.claimBasicData.claimState);
const url = await page.parsedUrl();
2018-11-07 07:38:09 +00:00
2019-06-27 06:41:07 +00:00
expect(url.hash).toContain('basic-data');
});
2019-01-07 08:33:07 +00:00
it('should click on the Claims button of the top bar menu', async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.claimsButton);
await page.wait(selectors.claimsIndex.searchClaimInput);
const url = await page.parsedUrl();
2018-11-07 07:38:09 +00:00
expect(url.hash).toEqual('#!/claim/index');
2018-10-25 14:44:03 +00:00
});
2019-01-07 08:33:07 +00:00
it('should search for the claim with id 4', async() => {
2020-04-08 09:24:40 +00:00
await page.write(selectors.claimsIndex.searchClaimInput, 4);
await page.waitToClick(selectors.claimsIndex.searchButton);
await page.waitForNumberOfElements(selectors.claimsIndex.searchResult, 1);
const result = await page.countElement(selectors.claimsIndex.searchResult);
2018-11-07 07:38:09 +00:00
expect(result).toEqual(1);
});
2019-01-07 08:33:07 +00:00
it('should click the Tickets button of the top bar menu', async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
await page.wait(selectors.ticketsIndex.topbarSearch);
const url = await page.parsedUrl();
2018-11-07 07:38:09 +00:00
expect(url.hash).toEqual('#!/ticket/index');
2018-10-25 14:44:03 +00:00
});
2019-06-27 06:41:07 +00:00
it('should search for a ticket then access to the sales section', async() => {
2020-04-08 09:24:40 +00:00
await page.accessToSearchResult(16);
await page.accessToSection('ticket.card.sale');
await page.waitForURL('/sale');
const url = await page.parsedUrl();
2018-11-07 07:38:09 +00:00
expect(url.hash).toContain('/sale');
2018-10-22 15:12:41 +00:00
});
2019-01-07 08:33:07 +00:00
it('should select the third sale and delete it', async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox);
await page.waitToClick(selectors.ticketSales.deleteSaleButton);
await page.waitToClick(selectors.ticketSales.acceptDeleteLineButton);
await page.waitForSpinnerLoad();
const message = await page.waitForSnackbar();
2018-11-07 07:38:09 +00:00
2020-04-08 09:24:40 +00:00
expect(message.type).toBe('success');
2018-10-25 14:44:03 +00:00
});
2018-10-22 15:12:41 +00:00
2019-01-07 08:33:07 +00:00
it(`should confirm the third sale was deleted`, async() => {
2020-04-08 09:24:40 +00:00
const result = await page.countElement(selectors.ticketSales.saleLine);
2018-11-07 07:38:09 +00:00
expect(result).toEqual(3);
});
it('should select the second sale and transfer it to a valid ticket', async() => {
2019-06-27 06:41:07 +00:00
const targetTicketId = 12;
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.secondSaleCheckbox);
await page.waitToClick(selectors.ticketSales.transferSaleButton);
await page.focusElement(selectors.ticketSales.transferQuantityCell);
await page.write(selectors.ticketSales.transferQuantityInput, '10\u000d');
await page.write(selectors.ticketSales.moveToTicketInput, targetTicketId);
await page.waitToClick(selectors.ticketSales.moveToTicketButton);
await page.waitForURL(`ticket/${targetTicketId}/sale`);
const result = await page.parsedUrl();
2018-11-07 07:38:09 +00:00
2019-06-27 06:41:07 +00:00
expect(result.hash).toContain(`ticket/${targetTicketId}/sale`);
2018-10-25 14:44:03 +00:00
});
2019-01-07 08:33:07 +00:00
it('should confirm the transfered line is the correct one', async() => {
2020-04-08 09:24:40 +00:00
await page.wait(selectors.ticketSales.secondSaleText);
const result = await page.waitToGetProperty(selectors.ticketSales.secondSaleText, 'innerText');
2018-11-07 07:38:09 +00:00
expect(result).toContain(`Melee weapon heavy shield`);
});
it('should confirm the transfered quantity is the correct one', async() => {
2020-04-08 09:24:40 +00:00
const result = await page.waitToGetProperty(selectors.ticketSales.secondSaleQuantityCell, 'innerText');
expect(result).toContain('10');
2018-10-25 14:44:03 +00:00
});
2019-01-07 08:33:07 +00:00
it('should go back to the original ticket sales section', async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketDescriptor.goBackToModuleIndexButton);
await page.accessToSearchResult(16);
await page.accessToSection('ticket.card.sale');
await page.waitForURL('/sale');
const url = await page.parsedUrl();
2018-11-07 07:38:09 +00:00
expect(url.hash).toContain('/sale');
2018-10-25 14:44:03 +00:00
});
it(`should confirm the original ticket has still three lines`, async() => {
2020-04-08 09:24:40 +00:00
await page.wait(selectors.ticketSales.saleLine);
const result = await page.countElement(selectors.ticketSales.saleLine);
2018-11-07 07:38:09 +00:00
expect(result).toEqual(3);
});
it(`should confirm the second sale quantity is now half of it's original value after the transfer`, async() => {
2020-04-08 09:24:40 +00:00
const result = await page.waitToGetProperty(selectors.ticketSales.secondSaleQuantityCell, 'innerText');
expect(result).toContain('10');
2018-10-25 14:44:03 +00:00
});
2019-01-07 08:33:07 +00:00
it('should go back to the receiver ticket sales section', async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketDescriptor.goBackToModuleIndexButton);
await page.accessToSearchResult(12);
await page.accessToSection('ticket.card.sale');
await page.waitForURL('/sale');
const url = await page.parsedUrl();
2018-11-07 07:38:09 +00:00
expect(url.hash).toContain('/sale');
2018-10-25 14:44:03 +00:00
});
2019-01-07 08:33:07 +00:00
it('should transfer the sale back to the original ticket', async() => {
2019-06-27 06:41:07 +00:00
const targetTicketId = 16;
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.secondSaleCheckbox);
await page.waitToClick(selectors.ticketSales.transferSaleButton);
await page.write(selectors.ticketSales.moveToTicketInput, targetTicketId);
await page.waitToClick(selectors.ticketSales.moveToTicketButton);
await page.waitForURL(`ticket/${targetTicketId}/sale`);
const result = await page.parsedUrl();
2018-11-07 07:38:09 +00:00
2019-06-27 06:41:07 +00:00
expect(result.hash).toContain(`ticket/${targetTicketId}/sale`);
2018-10-25 14:44:03 +00:00
});
2019-01-07 08:33:07 +00:00
it('should confirm the original ticket received the line', async() => {
const expectedLines = 4;
2020-04-08 09:24:40 +00:00
await page.waitForNumberOfElements(selectors.ticketSales.saleLine, expectedLines);
const result = await page.countElement(selectors.ticketSales.saleLine);
2018-11-07 07:38:09 +00:00
expect(result).toEqual(expectedLines);
2018-10-25 14:44:03 +00:00
});
2019-06-27 06:41:07 +00:00
it(`should throw an error when attempting to create a ticket for an inactive client`, async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.firstSaleCheckbox);
await page.waitToClick(selectors.ticketSales.transferSaleButton);
await page.waitToClick(selectors.ticketSales.moveToNewTicketButton);
await page.waitToClick(selectors.ticketSales.acceptDeleteTicketButton);
const message = await page.waitForSnackbar();
2019-06-27 06:41:07 +00:00
2020-04-08 09:24:40 +00:00
expect(message.text).toBe(`You can't create a ticket for a inactive client`);
2019-06-27 06:41:07 +00:00
});
it('should go now to the ticket sales section of an active, not frozen client', async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketDescriptor.goBackToModuleIndexButton);
await page.accessToSearchResult(13);
await page.accessToSection('ticket.card.sale');
await page.waitForURL('/sale');
const url = await page.parsedUrl();
2018-11-29 13:24:57 +00:00
expect(url.hash).toContain('/sale');
});
2019-06-27 06:41:07 +00:00
it(`should select all sales, tranfer them to a new ticket and delete the sender ticket as it would've been left empty`, async() => {
const senderTicketId = 13;
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.selectAllSalesCheckbox);
await page.waitToClick(selectors.ticketSales.transferSaleButton);
await page.waitToClick(selectors.ticketSales.moveToNewTicketButton);
await page.waitToClick(selectors.ticketSales.acceptDeleteTicketButton);
await page.wait((selector, ticketId) => {
return document.querySelector(selector).innerText.toLowerCase().indexOf(`${ticketId}`) == -1;
}, selectors.ticketDescriptor.idLabelValue, senderTicketId);
const url = await page.parsedUrl();
2018-11-07 07:38:09 +00:00
expect(url.hash).toContain('/sale');
});
2019-06-27 06:41:07 +00:00
it('should confirm the new ticket received the line', async() => {
2020-04-08 09:24:40 +00:00
const result = await page.countElement(selectors.ticketSales.saleLine);
2018-11-07 07:38:09 +00:00
2018-11-29 13:24:57 +00:00
expect(result).toEqual(1);
2018-10-25 14:44:03 +00:00
});
2019-01-07 08:33:07 +00:00
it('should check the first sale reserved icon isnt visible', async() => {
2020-04-08 09:24:40 +00:00
const result = await page.isVisible(selectors.ticketSales.firstSaleReservedIcon);
2018-11-07 07:38:09 +00:00
expect(result).toBeFalsy();
2018-10-25 14:44:03 +00:00
});
2019-01-07 08:33:07 +00:00
it('should mark the first sale as reserved', async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.firstSaleCheckbox);
await page.waitToClick(selectors.ticketSales.moreMenu);
await page.waitToClick(selectors.ticketSales.moreMenuReserve);
await page.waitForClassNotPresent(selectors.ticketSales.firstSaleReservedIcon, 'ng-hide');
const result = await page.isVisible(selectors.ticketSales.firstSaleReservedIcon);
2018-11-07 07:38:09 +00:00
expect(result).toBeTruthy();
2018-10-25 14:44:03 +00:00
});
2019-01-07 08:33:07 +00:00
it('should unmark the first sale as reserved', async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.moreMenu);
await page.waitToClick(selectors.ticketSales.moreMenuUnmarkReseved);
await page.waitForClassPresent(selectors.ticketSales.firstSaleReservedIcon, 'ng-hide');
const result = await page.isVisible(selectors.ticketSales.firstSaleReservedIcon);
2018-11-07 07:38:09 +00:00
expect(result).toBeFalsy();
});
2019-01-07 08:33:07 +00:00
it('should update all sales discount', async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.moreMenu);
await page.waitToClick(selectors.ticketSales.moreMenuUpdateDiscount);
// .write(selectors.ticketSales.moreMenuUpdateDiscountInput, 100) can't find the selector on app (deleted the selector), menu option was removed?
await page.write('body', '\u000d');
await page.waitForTextInElement(selectors.ticketSales.totalImport, '0.00');
const result = await page.waitToGetProperty(selectors.ticketSales.totalImport, 'innerText');
2018-11-07 07:38:09 +00:00
expect(result).toContain('0.00');
});
2019-06-27 06:41:07 +00:00
it('should log in as Production role and go to a target ticket summary', async() => {
2020-04-08 09:24:40 +00:00
await page.loginAndModule('production', 'ticket');
await page.accessToSearchResult(13);
await page.waitForURL('/summary');
const url = await page.parsedUrl();
2018-11-07 07:38:09 +00:00
2019-06-27 06:41:07 +00:00
expect(url.hash).toContain('/summary');
2018-10-25 14:44:03 +00:00
});
2019-06-27 06:41:07 +00:00
it(`should check it's state is deleted`, async() => {
2020-04-08 09:24:40 +00:00
const result = await page.waitToGetProperty(selectors.ticketDescriptor.stateLabelValue, 'innerText');
2018-11-07 07:38:09 +00:00
2019-06-27 06:41:07 +00:00
expect(result).toEqual('State Eliminado');
2018-10-25 14:44:03 +00:00
});
describe('when state is preparation and loged as Production', () => {
2019-01-07 08:33:07 +00:00
it(`should not be able to edit the sale price`, async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketDescriptor.goBackToModuleIndexButton);
await page.accessToSearchResult(8);
await page.accessToSection('ticket.card.sale');
await page.waitToClick(selectors.ticketSales.firstSalePrice);
const result = await page.exists(selectors.ticketSales.firstSalePriceInput);
2018-11-07 07:38:09 +00:00
expect(result).toBeFalsy();
});
2019-01-07 08:33:07 +00:00
it(`should not be able to edit the sale discount`, async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.firstSaleDiscount);
const result = await page.exists(selectors.ticketSales.firstSaleDiscountInput);
2018-11-07 07:38:09 +00:00
expect(result).toBeFalsy();
});
2019-01-07 08:33:07 +00:00
it(`should not be able to edit the sale state`, async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.stateMenuButton);
const result = await page.exists(selectors.ticketSales.stateMenuOptions);
2018-11-07 07:38:09 +00:00
expect(result).toBeFalsy();
});
2019-06-27 06:41:07 +00:00
it('should log in as salesPerson then go to the sales of a target ticket', async() => {
2020-04-08 09:24:40 +00:00
await page.loginAndModule('salesPerson', 'ticket');
await page.accessToSearchResult(8);
await page.accessToSection('ticket.card.sale');
await page.waitForURL('/sale');
const url = await page.parsedUrl();
2018-11-14 14:12:09 +00:00
expect(url.hash).toContain('/sale');
2018-11-14 14:12:09 +00:00
});
2018-10-25 14:44:03 +00:00
});
describe('when state is preparation and loged as salesPerson', () => {
2019-06-27 06:41:07 +00:00
it(`shouldn't be able to edit the sale price`, async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.firstSalePrice);
const result = await page.exists(selectors.ticketSales.firstSalePriceInput);
2018-11-07 07:38:09 +00:00
expect(result).toBeFalsy();
2018-10-25 14:44:03 +00:00
});
2019-06-27 06:41:07 +00:00
it(`should be able to edit the sale discount`, async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.firstSaleDiscount);
const result = await page.exists(selectors.ticketSales.firstSaleDiscountInput);
2018-11-07 07:38:09 +00:00
expect(result).toBeFalsy();
2018-10-25 14:44:03 +00:00
});
2019-06-27 06:41:07 +00:00
it(`should not be able to edit the sale state`, async() => {
2020-04-08 09:24:40 +00:00
await page.waitToClick(selectors.ticketSales.stateMenuButton);
const result = await page.exists(selectors.ticketSales.stateMenuOptions);
2018-11-07 07:38:09 +00:00
expect(result).toBeFalsy();
2018-10-25 14:44:03 +00:00
});
2018-11-08 14:20:42 +00:00
});
});