fix: test e2e
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2021-11-10 09:20:54 +01:00
parent 833822978a
commit 9010992add
1 changed files with 10 additions and 7 deletions

View File

@ -98,10 +98,19 @@ describe('Client balance path', () => {
expect(message.text).toContain('Data saved!');
});
it('should check the balance value is now -100', async() => {
let result = await page
.waitToGetProperty(selectors.clientBalance.firstLineBalance, 'innerText');
expect(result).toContain('-€100.00');
});
it('should create a new payment and check the cash exceeded the maximum', async() => {
const amountPaid = '1001';
await page.closePopup();
await page.waitToClick(selectors.clientBalance.newPaymentButton);
await page.autocompleteSearch(selectors.clientBalance.newPaymentBank, 'Cash');
await page.write(selectors.clientBalance.newPaymentAmount, amountPaid);
await page.clearInput(selectors.clientBalance.newDescription);
await page.write(selectors.clientBalance.newDescription, 'Payment');
@ -111,14 +120,8 @@ describe('Client balance path', () => {
expect(message.text).toContain('Amount exceeded');
});
it('should check the balance value is now -100', async() => {
let result = await page
.waitToGetProperty(selectors.clientBalance.firstLineBalance, 'innerText');
expect(result).toContain('-€100.00');
});
it('should create a new payment that sets the balance back to the original negative value', async() => {
await page.closePopup();
await page.waitToClick(selectors.clientBalance.newPaymentButton);
await page.autocompleteSearch(selectors.clientBalance.newPaymentBank, 'Pay on receipt');
await page.overwrite(selectors.clientBalance.newPaymentAmount, '-150');