diff --git a/test/cypress/integration/customer/clientCredits.spec.js b/test/cypress/integration/customer/clientCredits.spec.js index f39f3c06c..2d7c660f2 100644 --- a/test/cypress/integration/customer/clientCredits.spec.js +++ b/test/cypress/integration/customer/clientCredits.spec.js @@ -1,5 +1,8 @@ /// describe('Client credits', () => { + const credit = 100; + const descriptorCreditValue = '[data-cy="vnLvCredit"] > .value > span'; + beforeEach(() => { cy.viewport(1280, 720); cy.login('developer'); @@ -11,9 +14,19 @@ describe('Client credits', () => { it('Should put a new credit', () => { cy.get('.q-page').should('be.visible'); cy.dataCy('vnTableCreateBtn').click(); - cy.dataCy('Credit_input').type('100'); + cy.dataCy('Credit_input').type(credit); cy.dataCy('FormModelPopup_save').click(); cy.checkNotification('Data saved'); + cy.get(descriptorCreditValue) + .invoke('text') + .then((text) => { + const creditValue = parseInt( + text.trim().replace('€', '').split('.')[0], + 10, + ); + cy.log(creditValue); + expect(creditValue).to.equal(credit); + }); }); it('Should put a new credit with value 0 to close the client card', () => {