feat: improved test
gitea/salix-front/pipeline/pr-master There was a failure building this commit Details

This commit is contained in:
Jon Elias 2025-05-19 13:22:24 +02:00
parent 8e5b5f15f1
commit 547d0a2895
1 changed files with 14 additions and 1 deletions

View File

@ -1,5 +1,8 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('Client credits', () => { describe('Client credits', () => {
const credit = 100;
const descriptorCreditValue = '[data-cy="vnLvCredit"] > .value > span';
beforeEach(() => { beforeEach(() => {
cy.viewport(1280, 720); cy.viewport(1280, 720);
cy.login('developer'); cy.login('developer');
@ -11,9 +14,19 @@ describe('Client credits', () => {
it('Should put a new credit', () => { it('Should put a new credit', () => {
cy.get('.q-page').should('be.visible'); cy.get('.q-page').should('be.visible');
cy.dataCy('vnTableCreateBtn').click(); cy.dataCy('vnTableCreateBtn').click();
cy.dataCy('Credit_input').type('100'); cy.dataCy('Credit_input').type(credit);
cy.dataCy('FormModelPopup_save').click(); cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data saved'); 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', () => { it('Should put a new credit with value 0 to close the client card', () => {