Skip to content

Commit

Permalink
phased out the query checks in payments.spec.js
Browse files Browse the repository at this point in the history
  • Loading branch information
garyjzhao committed Jul 27, 2023
1 parent 1a45dc9 commit e690b42
Showing 1 changed file with 18 additions and 62 deletions.
80 changes: 18 additions & 62 deletions cypress/e2e/payments.spec.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,22 @@
import { aliasQuery } from '../support/graphql-test-utils';

describe('The Model Plan Payment Form', () => {
beforeEach(() => {
cy.localLogin({ name: 'MINT', role: 'MINT_USER_NONPROD' });

cy.intercept('POST', '/api/graph/query', req => {
aliasQuery(req, 'GetModelPlan');
aliasQuery(req, 'GetFunding');
aliasQuery(req, 'GetClaimsBasedPayment');
aliasQuery(req, 'GetAnticipateDependencies');
aliasQuery(req, 'GetBeneficiaryCostSharing');
aliasQuery(req, 'GetNonClaimsBasedPayment');
aliasQuery(req, 'GetComplexity');
aliasQuery(req, 'GetRecover');
});
});

it('completes a Model Plan Ops Eval and Learning form', () => {
cy.clickPlanTableByName('Empty Plan');

cy.wait('@GetModelPlan')
.its('response.statusCode')
.should('eq', 200)
.wait(500);

// Clicks the Payment tasklist item
cy.get('[data-testid="payment"]').click();

// Page - /payment

cy.wait('@GetFunding')
.its('response.statusCode')
.should('eq', 200)
.wait(500);

cy.location().should(loc => {
expect(loc.pathname).to.match(/\/models\/.{36}\/task-list\/payment/);
});

cy.get('#payment-funding-source-PATIENT_PROTECTION_AFFORDABLE_CARE_ACT')
.should('not.be.disabled')
.check({ force: true })
.should('be.checked');

Expand Down Expand Up @@ -72,17 +50,14 @@ describe('The Model Plan Payment Form', () => {

// Page - /payment/claims-based-payment

cy.wait('@GetClaimsBasedPayment')
.its('response.statusCode')
.should('eq', 200)
.wait(500);

cy.location().should(loc => {
expect(loc.pathname).to.match(
/\/models\/.{36}\/task-list\/payment\/claims-based-payment/
);
});

cy.get('[data-testid="fieldset"').first().should('not.be.disabled');

cy.get('#payment-pay-claims').within(() => {
cy.get("input[type='text']").click();
});
Expand Down Expand Up @@ -115,18 +90,14 @@ describe('The Model Plan Payment Form', () => {

// Page - /payment/anticipating-dependencies

cy.wait('@GetAnticipateDependencies')
.its('response.statusCode')
.should('eq', 200)
.wait(500);

cy.location().should(loc => {
expect(loc.pathname).to.match(
/\/models\/.{36}\/task-list\/payment\/anticipating-dependencies/
);
});

cy.get('#payment-creating-dependencies-between-services-true')
.should('not.be.disabled')
.check({ force: true })
.should('be.checked');

Expand All @@ -146,18 +117,14 @@ describe('The Model Plan Payment Form', () => {

// Page - /payment/beneficiary-cost-sharing

cy.wait('@GetBeneficiaryCostSharing')
.its('response.statusCode')
.should('eq', 200)
.wait(500);

cy.location().should(loc => {
expect(loc.pathname).to.match(
/\/models\/.{36}\/task-list\/payment\/beneficiary-cost-sharing/
);
});

cy.get('#payment-beneficiary-cost-sharing')
.should('not.be.disabled')
.type('Bill in accounting')
.should('have.value', 'Bill in accounting');

Expand All @@ -177,17 +144,14 @@ describe('The Model Plan Payment Form', () => {

// Page - /payment/non-claims-based-payment

cy.wait('@GetNonClaimsBasedPayment')
.its('response.statusCode')
.should('eq', 200)
.wait(500);

cy.location().should(loc => {
expect(loc.pathname).to.match(
/\/models\/.{36}\/task-list\/payment\/non-claims-based-payment/
);
});

cy.get('[data-testid="fieldset"').first().should('not.be.disabled');

cy.get('#payment-nonclaims-payments').within(() => {
cy.get("input[type='text']").click();
});
Expand Down Expand Up @@ -222,18 +186,14 @@ describe('The Model Plan Payment Form', () => {

// Page - /payment/complexity

cy.wait('@GetComplexity')
.its('response.statusCode')
.should('eq', 200)
.wait(500);

cy.location().should(loc => {
expect(loc.pathname).to.match(
/\/models\/.{36}\/task-list\/payment\/complexity/
);
});

cy.get('#payment-complexity-LOW')
.should('not.be.disabled')
.check({ force: true })
.should('be.checked');

Expand Down Expand Up @@ -263,18 +223,14 @@ describe('The Model Plan Payment Form', () => {

// Page - /payment/recover-payment

cy.wait('@GetRecover')
.its('response.statusCode')
.should('eq', 200)
.wait(500);

cy.location().should(loc => {
expect(loc.pathname).to.match(
/\/models\/.{36}\/task-list\/payment\/recover-payment/
);
});

cy.get('#payment-recover-payment-true')
.should('not.be.disabled')
.check({ force: true })
.should('be.checked');

Expand All @@ -286,14 +242,14 @@ describe('The Model Plan Payment Form', () => {
.type('10/26/2028')
.should('have.value', '10/26/2028');

cy.contains('button', 'Save and start next Model Plan section').should(
'not.exist'
);

// Uncomment the code below once IT Lead Experience is PROD
// cy.contains('button', 'Continue to IT solutions and implementation status').click();
// cy.location().should(loc => {
// expect(loc.pathname).to.match(/\/models\/.{36}\/task-list\/it-solutions$/);
// });
cy.contains(
'button',
'Continue to IT solutions and implementation status'
).click();
cy.location().should(loc => {
expect(loc.pathname).to.match(
/\/models\/.{36}\/task-list\/it-solutions$/
);
});
});
});

0 comments on commit e690b42

Please sign in to comment.