Bug/Test #1607 ticket.updateDiscount and fix test
gitea/salix/master This commit looks good Details

This commit is contained in:
Bernat 2019-07-31 07:46:24 +02:00 committed by Joan Sanchez
parent 2ff374e7ba
commit 4e329a4201
7 changed files with 8 additions and 7 deletions

View File

@ -1446,7 +1446,8 @@ INSERT INTO `vn`.`ticketRequest`(`id`, `description`, `requesterFk`, `atenderFk`
(1, 'Ranged weapon longbow 2m', 18, 35, 5, 1, 9.10, 1, 1, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
(2, 'Melee weapon combat first 15cm', 18, 35, 10, 2, 1.07, 0, NULL, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
(3, 'Melee weapon heavy shield 1x0.5m', 18, 35, 20, 4, 3.06, 0, NULL, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
(4, 'Melee weapon combat first 15cm', 18, 35, 15, NULL, 1.30, NULL, NULL, 11, CURDATE());
(4, 'Melee weapon combat first 15cm', 18, 35, 15, NULL, 1.30, NULL, NULL, 11, CURDATE()),
(5, 'Melee weapon combat first 15cm', 18, 35, 15, 4, 1.30, 0, NULL, 18, CURDATE());
INSERT INTO `vn`.`ticketServiceType`(`id`, `name`)
VALUES

View File

@ -381,6 +381,7 @@ describe('Worker time control path', () => {
it(`should check Hank Pym doesn't have hours set on the next months first week`, async() => {
const wholeWeekHours = await nightmare
.waitToClick(selectors.workerTimeControl.nextMonthButton)
.waitToClick(selectors.workerTimeControl.nextMonthButton)
.waitToGetProperty(selectors.workerTimeControl.weekWorkedHours, 'innerText');

View File

@ -53,7 +53,7 @@ module.exports = Self => {
false
]);
if (stock.available < ctx.args.quantity)
if (stock.available < 0)
throw new UserError(`This item is not available`);

View File

@ -39,8 +39,8 @@ describe('ticket-request confirm()', () => {
});
it(`should throw an error if the item is not available`, async() => {
const requestId = 4;
const itemId = 1;
const requestId = 5;
const itemId = 4;
const quantity = 99999;
let ctx = {req: {accessToken: {userId: 9}}, args: {

View File

@ -6,7 +6,7 @@ describe('ticket-request filter()', () => {
let result = await app.models.TicketRequest.filter(ctx);
expect(result.length).toEqual(1);
expect(result.length).toEqual(2);
});
it('should return the ticket request matching a generic search value which is the ticket ID', async() => {

View File

@ -54,7 +54,6 @@ module.exports = Self => {
line.item = map[line.itemFk];
line.claim = claimMap[line.id];
}
return lines;
};
};

View File

@ -86,7 +86,7 @@
</vn-icon>
</a>
<vn-icon
ng-show="!sale.visible || !sale.available || sale.visible < 0 || sale.available < 0"
ng-show=" sale.visible < 0 || sale.available < 0"
color-main
icon="warning"
vn-tooltip="Visible: {{::sale.visible || 0}} <br> {{::$ctrl.$translate.instant('Available')}}: {{::sale.available || 0}}">