fix test and update fixtures #9153
This commit is contained in:
parent
3bdc202732
commit
bb8a9e2035
|
@ -415,11 +415,12 @@ export default {
|
||||||
ticketService: {
|
ticketService: {
|
||||||
serviceButton: 'vn-left-menu a[ui-sref="ticket.card.service"]',
|
serviceButton: 'vn-left-menu a[ui-sref="ticket.card.service"]',
|
||||||
addServiceButton: 'vn-ticket-service > form > vn-card > div > vn-one:nth-child(3) > vn-icon-button > button > vn-icon',
|
addServiceButton: 'vn-ticket-service > form > vn-card > div > vn-one:nth-child(3) > vn-icon-button > button > vn-icon',
|
||||||
descriptionInput: 'vn-ticket-service vn-textfield[label="Description"] input',
|
firstDescriptionInput: 'vn-ticket-service vn-textfield[label="Description"] input',
|
||||||
quantityInput: 'vn-ticket-service vn-textfield[label="Quantity"] input',
|
firstQuantityInput: 'vn-ticket-service vn-textfield[label="Quantity"] input',
|
||||||
priceInput: 'vn-ticket-service vn-textfield[label="Price"] input',
|
firstPriceInput: 'vn-ticket-service vn-textfield[label="Price"] input',
|
||||||
vatTypeAutocomplete: 'vn-ticket-service vn-autocomplete[label="Tax class"]',
|
firstVatTypeAutocomplete: 'vn-ticket-service vn-autocomplete[label="Tax class"]',
|
||||||
fistDeleteServiceButton: 'vn-ticket-service > form > vn-card > div > vn-one:nth-child(2) > vn-horizontal > vn-auto > vn-icon',
|
fistDeleteServiceButton: 'vn-ticket-service > form > vn-card > div > vn-one:nth-child(2) > vn-horizontal > vn-auto > vn-icon',
|
||||||
|
serviceLine: 'vn-ticket-service > form > vn-card > div > vn-one:nth-child(2) > vn-horizontal',
|
||||||
saveServiceButton: `${components.vnSubmit}`
|
saveServiceButton: `${components.vnSubmit}`
|
||||||
},
|
},
|
||||||
createStateView: {
|
createStateView: {
|
||||||
|
|
|
@ -11,47 +11,49 @@ describe('Ticket services path', () => {
|
||||||
.accessToSection('ticket.card.service');
|
.accessToSection('ticket.card.service');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create a new service', async() => {
|
it('should edit the first service', async() => {
|
||||||
const result = await nightmare
|
const result = await nightmare
|
||||||
.waitToClick(selectors.ticketService.addServiceButton)
|
.clearInput(selectors.ticketService.firstDescriptionInput)
|
||||||
.write(selectors.ticketService.descriptionInput, 'my service')
|
.write(selectors.ticketService.firstDescriptionInput, 'my service')
|
||||||
.clearInput(selectors.ticketService.quantityInput)
|
.clearInput(selectors.ticketService.firstQuantityInput)
|
||||||
.write(selectors.ticketService.quantityInput, 99)
|
.write(selectors.ticketService.firstQuantityInput, 99)
|
||||||
.write(selectors.ticketService.priceInput, 999)
|
.clearInput(selectors.ticketService.firstPriceInput)
|
||||||
.autocompleteSearch(selectors.ticketService.vatTypeAutocomplete, 'Reduced VAT')
|
.write(selectors.ticketService.firstPriceInput, 999)
|
||||||
|
.autocompleteSearch(selectors.ticketService.firstVatTypeAutocomplete, 'Reduced VAT')
|
||||||
|
.waitForTextInInput(`${selectors.ticketService.firstVatTypeAutocomplete} Input`, 'Reduced VAT')
|
||||||
.waitToClick(selectors.ticketService.saveServiceButton)
|
.waitToClick(selectors.ticketService.saveServiceButton)
|
||||||
.waitForLastSnackbar();
|
.waitForLastSnackbar();
|
||||||
|
|
||||||
expect(result).toEqual('Data saved!');
|
expect(result).toEqual('Data saved!');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should confirm the service description was created correctly', async() => {
|
it('should confirm the service description was edited correctly', async() => {
|
||||||
const result = await nightmare
|
const result = await nightmare
|
||||||
.waitToClick(selectors.ticketBasicData.basicDataButton)
|
.waitToClick(selectors.ticketBasicData.basicDataButton)
|
||||||
.wait(selectors.ticketBasicData.clientAutocomplete)
|
.wait(selectors.ticketBasicData.clientAutocomplete)
|
||||||
.click(selectors.ticketService.serviceButton)
|
.click(selectors.ticketService.serviceButton)
|
||||||
.waitToGetProperty(selectors.ticketService.descriptionInput, 'value');
|
.waitToGetProperty(selectors.ticketService.firstDescriptionInput, 'value');
|
||||||
|
|
||||||
expect(result).toEqual('my service');
|
expect(result).toEqual('my service');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should confirm the service quantity was created correctly', async() => {
|
it('should confirm the service quantity was edited correctly', async() => {
|
||||||
const result = await nightmare
|
const result = await nightmare
|
||||||
.waitToGetProperty(selectors.ticketService.quantityInput, 'value');
|
.waitToGetProperty(selectors.ticketService.firstQuantityInput, 'value');
|
||||||
|
|
||||||
expect(result).toEqual('99');
|
expect(result).toEqual('99');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should confirm the service price was created correctly', async() => {
|
it('should confirm the service price was edited correctly', async() => {
|
||||||
const result = await nightmare
|
const result = await nightmare
|
||||||
.waitToGetProperty(selectors.ticketService.priceInput, 'value');
|
.waitToGetProperty(selectors.ticketService.firstPriceInput, 'value');
|
||||||
|
|
||||||
expect(result).toEqual('999');
|
expect(result).toEqual('999');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should confirm the service VAT was created correctly', async() => {
|
it('should confirm the service VAT was edited correctly', async() => {
|
||||||
const result = await nightmare
|
const result = await nightmare
|
||||||
.waitToGetProperty(`${selectors.ticketService.vatTypeAutocomplete} input`, 'value');
|
.waitToGetProperty(`${selectors.ticketService.firstVatTypeAutocomplete} input`, 'value');
|
||||||
|
|
||||||
expect(result).toEqual('Reduced VAT');
|
expect(result).toEqual('Reduced VAT');
|
||||||
});
|
});
|
||||||
|
@ -70,9 +72,9 @@ describe('Ticket services path', () => {
|
||||||
.waitToClick(selectors.ticketBasicData.basicDataButton)
|
.waitToClick(selectors.ticketBasicData.basicDataButton)
|
||||||
.wait(selectors.ticketBasicData.clientAutocomplete)
|
.wait(selectors.ticketBasicData.clientAutocomplete)
|
||||||
.click(selectors.ticketService.serviceButton)
|
.click(selectors.ticketService.serviceButton)
|
||||||
.waitForNumberOfElements(selectors.ticketService.descriptionInput, 0)
|
.waitForNumberOfElements(selectors.ticketService.serviceLine, 2)
|
||||||
.countElement(selectors.ticketService.descriptionInput);
|
.countElement(selectors.ticketService.serviceLine);
|
||||||
|
|
||||||
expect(result).toEqual(0);
|
expect(result).toEqual(2);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,7 +17,7 @@ describe('Client activeWorkersWithRole', () => {
|
||||||
|
|
||||||
let isBuyer = await app.models.Account.hasRole(result[0].id, 'buyer');
|
let isBuyer = await app.models.Account.hasRole(result[0].id, 'buyer');
|
||||||
|
|
||||||
expect(result.length).toEqual(9);
|
expect(result.length).toEqual(10);
|
||||||
expect(isBuyer).toBeTruthy();
|
expect(isBuyer).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
ALTER TABLE `vn`.`ticketService`
|
||||||
|
ADD COLUMN `ticketFk` INT(11) NOT NULL AFTER `taxClassFk`;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE `vn`.`ticketService`
|
||||||
|
ADD INDEX `fgn_ticketFk_idx` (`ticketFk` ASC);
|
||||||
|
ALTER TABLE `vn`.`ticketService`
|
||||||
|
ADD CONSTRAINT `fgn_ticketFk`
|
||||||
|
FOREIGN KEY (`ticketFk`)
|
||||||
|
REFERENCES `vn2008`.`Tickets` (`Id_Ticket`)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE;
|
|
@ -1037,8 +1037,8 @@ INSERT INTO `vn`.`ticketRequest`(`id`, `description`, `requesterFk`, `atenderFk`
|
||||||
(3, 'Object4 Armor2 2', 18, 35, 20, 3.06, 0, NULL, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
|
(3, 'Object4 Armor2 2', 18, 35, 20, 3.06, 0, NULL, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
|
||||||
(4, 'Object2 Gem2 3', 18, 35, 15, 1.30, NULL, NULL, 11, CURDATE());
|
(4, 'Object2 Gem2 3', 18, 35, 15, 1.30, NULL, NULL, 11, CURDATE());
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`ticketService`(`id`, `description`, `quantity`, `price`, `taxClassFk`, `ticketFk`)
|
||||||
|
VALUES
|
||||||
delete from `account`.`roleRole` where role =52 and inheritsFrom = 35;
|
(1, 'delivery charge', 1, 2.00, 1, 1),
|
||||||
|
(2, 'training course', 1, 10.00, 1, 2),
|
||||||
delete from `account`.`roleInherit` where role =52 and inheritsFrom = 35;
|
(3, 'delivery charge', 1, 5.50, 1, 11);
|
Loading…
Reference in New Issue