Skip to content

Commit

Permalink
Merge branch 'NEW_improve_test_coverage' of github.com:Som-Energia/we…
Browse files Browse the repository at this point in the history
…bforms-ui into NEW_improve_test_coverage
  • Loading branch information
dukenuken09 committed Sep 20, 2024
2 parents d04aad7 + 55d3f12 commit 20dec14
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions cypress/integration/modifyTariff/modifyTariff.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@ describe('Modify Tariff', () => {
console.error(error)
return false
})

beforeEach(() => {
cy.fixture('generalContractTerms.html').as('html')
cy.visit('/ca/contract/indexed')

cy.intercept('GET', '/ping', {
statusCode: 200,
body: {
state: true,
status: "ONLINE"
}
})

cy.intercept('GET', '/procedures/can_turn_contract_indexed', {
statusCode: 200,
body: {
Expand All @@ -34,12 +41,22 @@ describe('Modify Tariff', () => {
})

it('Change Tariff to indexada', function () {
cy.intercept('GET', `/static/docs/ca/general-contract-terms.html`, {
statusCode: 200,
headers: {'content-type':'text/html'},
body: this.html
}).as('generalTerms')

cy.get('[data-cy="next"]').click()

cy.get('[data-cy="next"]').click()

cy.get('[id=change-tarif-terms-check]').click()

cy.wait('@generalTerms')
.its('response.statusCode')
.should('be.oneOf', [200, 304])

cy.get('[id=terms-dialog-accept-btn]').click()

cy.get('[id=change-tariff-indexada-terms-check]').click()
Expand Down

0 comments on commit 20dec14

Please sign in to comment.