#1362 ticket.packaging negative quantity
This commit is contained in:
parent
37293ad695
commit
4ac36e6bf2
|
@ -41,21 +41,10 @@ describe('Ticket Create packages path', () => {
|
||||||
expect(result).toBeTruthy();
|
expect(result).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should attempt create a new package but receive an error if the quantity is invalid`, async() => {
|
|
||||||
const result = await nightmare
|
|
||||||
.write(selectors.ticketPackages.firstQuantityInput, -99)
|
|
||||||
.waitToClick(selectors.ticketPackages.savePackagesButton)
|
|
||||||
.evaluate(selector => {
|
|
||||||
return document.querySelector(selector).checkValidity();
|
|
||||||
}, selectors.ticketPackages.firstQuantityInput);
|
|
||||||
|
|
||||||
expect(result).toBeFalsy();
|
|
||||||
});
|
|
||||||
|
|
||||||
it(`should create a new package with correct data`, async() => {
|
it(`should create a new package with correct data`, async() => {
|
||||||
const result = await nightmare
|
const result = await nightmare
|
||||||
.clearInput(selectors.ticketPackages.firstQuantityInput)
|
.clearInput(selectors.ticketPackages.firstQuantityInput)
|
||||||
.write(selectors.ticketPackages.firstQuantityInput, 99)
|
.write(selectors.ticketPackages.firstQuantityInput, -99)
|
||||||
.waitToClick(selectors.ticketPackages.savePackagesButton)
|
.waitToClick(selectors.ticketPackages.savePackagesButton)
|
||||||
.waitForLastSnackbar();
|
.waitForLastSnackbar();
|
||||||
|
|
||||||
|
@ -73,9 +62,9 @@ describe('Ticket Create packages path', () => {
|
||||||
|
|
||||||
it(`should confirm the first quantity is just a number and the string part was ignored by the imput number`, async() => {
|
it(`should confirm the first quantity is just a number and the string part was ignored by the imput number`, async() => {
|
||||||
const result = await nightmare
|
const result = await nightmare
|
||||||
.waitForTextInInput(selectors.ticketPackages.firstQuantityInput, '99')
|
.waitForTextInInput(selectors.ticketPackages.firstQuantityInput, '-99')
|
||||||
.waitToGetProperty(selectors.ticketPackages.firstQuantityInput, 'value');
|
.waitToGetProperty(selectors.ticketPackages.firstQuantityInput, 'value');
|
||||||
|
|
||||||
expect(result).toEqual('99');
|
expect(result).toEqual('-99');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
field="package.packagingFk">
|
field="package.packagingFk">
|
||||||
<tpl-item>{{itemFk}} : {{name}}</tpl-item>
|
<tpl-item>{{itemFk}} : {{name}}</tpl-item>
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
<vn-input-number vn-one min="1" step="1"
|
<vn-input-number vn-one step="1"
|
||||||
label="Quantity"
|
label="Quantity"
|
||||||
model="package.quantity"
|
model="package.quantity"
|
||||||
rule="TicketPackaging.quantity">
|
rule="TicketPackaging.quantity">
|
||||||
|
|
Loading…
Reference in New Issue