#1430 client.balance bug fix and e2e fix
gitea/salix/dev This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2019-05-15 15:26:13 +02:00
parent 41c20d977c
commit 417dc511f5
4 changed files with 7 additions and 7 deletions

View File

@ -87,11 +87,11 @@ describe('Client balance path', () => {
expect(result).toContain('Data saved!');
});
it('should check balance is now 100', async() => {
it('should check balance is now -100', async() => {
let result = await nightmare
.waitToGetProperty(selectors.clientBalance.firstBalanceLine, 'innerText');
expect(result).toContain('100.00');
expect(result).toContain('-€100.00');
});
it('should again click the new payment button', async() => {
@ -107,18 +107,17 @@ describe('Client balance path', () => {
let result = await nightmare
.clearInput(selectors.clientBalance.newPaymentAmountInput)
.write(selectors.clientBalance.newPaymentAmountInput, '-150')
.wait(1999)
.waitToClick(selectors.clientBalance.saveButton)
.waitForLastSnackbar();
expect(result).toContain('Data saved!');
});
it('should check balance is now -50', async() => {
it('should check balance is now 50', async() => {
let result = await nightmare
.waitToGetProperty(selectors.clientBalance.firstBalanceLine, 'innerText');
expect(result).toContain('50.00');
expect(result).toContain('50');
});
it('should now click on the Clients button of the top bar menu', async() => {

View File

@ -46,7 +46,7 @@ export default class InputNumber extends Input {
set value(value) {
this.hasValue = !(value === null || value === undefined || value === '');
if (!this.hasOwnProperty('_value') && this.hasValue)
if (!this.hasOwnProperty('_value') && this.hasValue || value === '')
this.input.value = value;
this._value = value;

View File

@ -55,6 +55,7 @@ module.exports = Self => {
i.id,
TRUE,
i.issued,
NULL,
c.code,
i.created,
i.ref,
@ -62,7 +63,6 @@ module.exports = Self => {
NULL,
NULL,
NULL,
NULL,
i.clientFk,
i.pdf,
TRUE isInvoice

View File

@ -32,6 +32,7 @@ class Controller {
setOrder(value) {
this.params.params.companyFk = value;
this.filter.where.companyFk = value;
this.refresh();
}
refresh() {