feat: improved test
gitea/salix-front/pipeline/pr-master There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-master There was a failure building this commit
Details
This commit is contained in:
parent
8e5b5f15f1
commit
547d0a2895
|
@ -1,5 +1,8 @@
|
|||
/// <reference types="cypress" />
|
||||
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', () => {
|
||||
|
|
Loading…
Reference in New Issue