negative package quantity
gitea/salix/master This commit looks good Details

This commit is contained in:
Bernat 2019-04-24 11:36:13 +02:00 committed by Joan Sanchez
parent bd605a5d9d
commit 7b59164fed
2 changed files with 5 additions and 15 deletions

View File

@ -41,20 +41,10 @@ describe('Ticket Create packages path', () => {
expect(result).toEqual('Some fields are invalid'); expect(result).toEqual('Some fields are invalid');
}); });
it(`should attempt create a new package but receive an error if package is blank`, async() => {
const result = await nightmare
.clearInput(selectors.ticketPackages.firstQuantityInput)
.write(selectors.ticketPackages.firstQuantityInput, 99)
.waitToClick(selectors.ticketPackages.clearPackageAutocompleteButton)
.waitToClick(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar();
expect(result).toEqual('Package cannot be blank');
});
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
.autocompleteSearch(selectors.ticketPackages.firstPackageAutocomplete, 'Legendary Box') .clearInput(selectors.ticketPackages.firstQuantityInput)
.write(selectors.ticketPackages.firstQuantityInput, -99)
.waitToClick(selectors.ticketPackages.savePackagesButton) .waitToClick(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
@ -72,9 +62,9 @@ describe('Ticket Create packages path', () => {
it(`should confirm the first quantity is the expected one`, async() => { it(`should confirm the first quantity is the expected one`, 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');
}); });
}); });

View File

@ -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">