chore: refs #4074 fix test
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-09-09 15:59:17 +02:00
parent 579ac481f3
commit 45649359be
1 changed files with 16 additions and 11 deletions

View File

@ -18,7 +18,7 @@ const $ = {
watcher: 'vn-client-billing-data vn-watcher' watcher: 'vn-client-billing-data vn-watcher'
}; };
describe('Client Edit billing data path', () => { fdescribe('Client Edit billing data path', () => {
let browser; let browser;
let page; let page;
beforeAll(async() => { beforeAll(async() => {
@ -35,6 +35,14 @@ describe('Client Edit billing data path', () => {
it(`should attempt to edit the billing data without an IBAN but fail`, async() => { it(`should attempt to edit the billing data without an IBAN but fail`, async() => {
await page.autocompleteSearch($.payMethod, 'PayMethod with IBAN'); await page.autocompleteSearch($.payMethod, 'PayMethod with IBAN');
await page.waitToClick($.saveButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('That payment method requires an IBAN');
});
it(`should edit the billing data and save the form`, async() => {
await page.autocompleteSearch($.payMethod, 'PayMethod five');
await page.autocompleteSearch($.swiftBic, 'BBKKESMMMMM'); await page.autocompleteSearch($.swiftBic, 'BBKKESMMMMM');
await page.clearInput($.dueDay); await page.clearInput($.dueDay);
await page.write($.dueDay, '60'); await page.write($.dueDay, '60');
@ -45,10 +53,13 @@ describe('Client Edit billing data path', () => {
await page.waitToClick($.saveButton); await page.waitToClick($.saveButton);
const message = await page.waitForSnackbar(); const message = await page.waitForSnackbar();
expect(message.text).toContain('That payment method requires an IBAN'); expect(message.text).toContain('Notification sent!');
}); });
it(`should create a new BIC code`, async() => { it(`should create a new BIC code`, async() => {
await page.loginAndModule('financial', 'client');
await page.accessToSearchResult('Bruce Banner');
await page.accessToSection('client.card.billingData');
await page.waitToClick($.newBankEntityButton); await page.waitToClick($.newBankEntityButton);
await page.write($.newBankEntityName, 'Gotham City Bank'); await page.write($.newBankEntityName, 'Gotham City Bank');
await page.write($.newBankEntityBIC, 'GTHMCT'); await page.write($.newBankEntityBIC, 'GTHMCT');
@ -66,7 +77,7 @@ describe('Client Edit billing data path', () => {
it(`should confirm the IBAN pay method was sucessfully saved`, async() => { it(`should confirm the IBAN pay method was sucessfully saved`, async() => {
const payMethod = await page.waitToGetProperty($.payMethod, 'value'); const payMethod = await page.waitToGetProperty($.payMethod, 'value');
expect(payMethod).toEqual('PayMethod with IBAN'); expect(payMethod).toEqual('PayMethod five');
}); });
it(`should clear the BIC code field, update the IBAN to see how he BIC code autocompletes`, async() => { it(`should clear the BIC code field, update the IBAN to see how he BIC code autocompletes`, async() => {
@ -79,14 +90,6 @@ describe('Client Edit billing data path', () => {
expect(automaticCode).toEqual('CAIXESBB'); expect(automaticCode).toEqual('CAIXESBB');
}); });
it(`should save the form with all its new data`, async() => {
await page.waitForWatcherData($.watcher);
await page.waitToClick($.saveButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Notification sent!');
});
it('should confirm the billing data have been edited', async() => { it('should confirm the billing data have been edited', async() => {
const dueDate = await page.waitToGetProperty($.dueDay, 'value'); const dueDate = await page.waitToGetProperty($.dueDay, 'value');
const IBAN = await page.waitToGetProperty($.IBAN, 'value'); const IBAN = await page.waitToGetProperty($.IBAN, 'value');
@ -94,7 +97,9 @@ describe('Client Edit billing data path', () => {
const receivedCoreLCR = await page.checkboxState($.receivedCoreLCRCheckbox); const receivedCoreLCR = await page.checkboxState($.receivedCoreLCRCheckbox);
const receivedCoreVNL = await page.checkboxState($.receivedCoreVNLCheckbox); const receivedCoreVNL = await page.checkboxState($.receivedCoreVNLCheckbox);
const receivedB2BVNL = await page.checkboxState($.receivedB2BVNLCheckbox); const receivedB2BVNL = await page.checkboxState($.receivedB2BVNLCheckbox);
const payMethod = await page.waitToGetProperty($.payMethod, 'value');
expect(payMethod).toEqual('PayMethod five');
expect(dueDate).toEqual('60'); expect(dueDate).toEqual('60');
expect(IBAN).toEqual('ES9121000418450200051332'); expect(IBAN).toEqual('ES9121000418450200051332');
expect(swiftBic).toEqual('CAIXESBB'); expect(swiftBic).toEqual('CAIXESBB');