Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EASI-2990] Disable forms until all data loaded #649

Merged
merged 36 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
50709eb
loading state for collaborators
garyjzhao Jul 19, 2023
d1672a7
adding fieldset loading to addCollaborator page
garyjzhao Jul 19, 2023
490040b
adding fieldset loading to addCRTDLpage
garyjzhao Jul 19, 2023
f30b4db
adding fieldset loading to addCRTDLpage
garyjzhao Jul 20, 2023
22a66bd
adding fieldset loading to questionandreply
garyjzhao Jul 20, 2023
563b6d2
adding fieldset loading to Basic Task List index
garyjzhao Jul 20, 2023
7900735
adding fieldset loading to Basic Overview Task List index
garyjzhao Jul 20, 2023
8a7019d
adding fieldset loading to beneficiaries tasklist index
garyjzhao Jul 20, 2023
8499636
adding fieldset loading to beneficiaries people impact tasklist index
garyjzhao Jul 20, 2023
89f512b
including additional loading states
garyjzhao Jul 20, 2023
bd8c1a6
adding fieldset disabled loading to the files
garyjzhao Jul 20, 2023
f3c8918
add fieldset disabled loading to select solution index
garyjzhao Jul 20, 2023
83287b3
add loading disabled to all the things
garyjzhao Jul 20, 2023
5a2b64c
add more
garyjzhao Jul 20, 2023
a95eda8
update snaps
garyjzhao Jul 20, 2023
b490de6
move user event into waitfor function
garyjzhao Jul 20, 2023
6ed7964
Merge branch 'main' into EASI-2990/disable-forms-until-all-data-loaded
garyjzhao Jul 20, 2023
56c4492
Test opsEvalAndLearning spec with disabled form checks
patrickseguraoddball Jul 25, 2023
4c9f5b8
Merge branch 'main' into EASI-2990/disable-forms-until-all-data-loaded
garyjzhao Jul 25, 2023
775a3ad
adding error to the fieldset disabled
garyjzhao Jul 25, 2023
c1eedff
change the way the test is run
garyjzhao Jul 25, 2023
52c15bb
fix collaborator e2e test
garyjzhao Jul 25, 2023
6b3b3df
fix discussion e2e test
garyjzhao Jul 25, 2023
96cd7b7
Remove commented code
garyjzhao Jul 26, 2023
3707c79
wip to add loading checks in cypress
garyjzhao Jul 26, 2023
15eac5e
using fieldest disabled based on error or loading instead of removing…
garyjzhao Jul 26, 2023
9b58cfd
phased out the query checks
garyjzhao Jul 26, 2023
5879a9d
phased out the query checks
garyjzhao Jul 26, 2023
cf0bf73
phased out the query checks in characteristics.spec.js
garyjzhao Jul 27, 2023
cf6e8a6
change the way the disabled check works
garyjzhao Jul 27, 2023
10dad15
phasing out the query checks in ParticipantsAndProviders.spec.js
garyjzhao Jul 27, 2023
1a45dc9
add additional check in the clickPlanTableByName command
garyjzhao Jul 27, 2023
e690b42
phased out the query checks in payments.spec.js
garyjzhao Jul 27, 2023
1727fcc
add a few comments for cypress test
garyjzhao Jul 27, 2023
d30d83d
Merge branch 'main' into EASI-2990/disable-forms-until-all-data-loaded
garyjzhao Jul 27, 2023
14be28c
updating snaps
garyjzhao Jul 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 7 additions & 39 deletions cypress/e2e/characteristics.spec.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
import { aliasQuery } from '../support/graphql-test-utils';

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

cy.intercept('POST', '/api/graph/query', req => {
aliasQuery(req, 'GetGeneralCharacteristics');
aliasQuery(req, 'GetKeyCharacteristics');
aliasQuery(req, 'GetInvolvements');
aliasQuery(req, 'GetTargetsAndOptions');
aliasQuery(req, 'GetAuthority');
});
});

it('completes a Model Plan Characteristics', () => {
Expand All @@ -19,19 +9,14 @@ describe('The Model Plan General Characteristics Form', () => {
// Clicks the General Charactstics tasklist item
cy.get('[data-testid="characteristics"]').click();

// Page - /characteristics

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

// Page - /characteristics

cy.wait('@GetGeneralCharacteristics')
.its('response.statusCode')
.should('eq', 200)
.wait(100);

cy.get('[data-testid="model-plan-name"]').contains('for Empty Plan');

cy.get('#plan-characteristics-is-new-model-no')
Expand Down Expand Up @@ -74,13 +59,8 @@ describe('The Model Plan General Characteristics Form', () => {

// Page - /characteristics/key-charactertics

cy.wait('@GetKeyCharacteristics')
.its('response.statusCode')
.should('eq', 200)
.wait(100);

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

Expand All @@ -90,6 +70,7 @@ describe('The Model Plan General Characteristics Form', () => {

cy.get('#plan-characteristics-key-characteristics').within(() => {
cy.get("input[type='text']")
.should('not.be.disabled')
.type('payment')
.should('have.value', 'payment');
});
Expand All @@ -108,13 +89,8 @@ describe('The Model Plan General Characteristics Form', () => {

// Page - /characteristics/involvements

cy.wait('@GetInvolvements')
.its('response.statusCode')
.should('eq', 200)
.wait(100);

cy.get('#plan-characteristics-care-coordination-involved')
.check({ force: true })
.should('not.be.disabled')
.check({ force: true })
.should('be.checked');

Expand Down Expand Up @@ -148,12 +124,8 @@ describe('The Model Plan General Characteristics Form', () => {

// Page - /characteristics/targets-and-options

cy.wait('@GetTargetsAndOptions')
.its('response.statusCode')
.should('eq', 200)
.wait(100);

cy.get('#plan-characteristics-geographies-targeted')
.should('not.be.disabled')
.check({ force: true })
.should('be.checked');

Expand Down Expand Up @@ -189,12 +161,8 @@ describe('The Model Plan General Characteristics Form', () => {

// Page - /characteristics/authority

cy.wait('@GetAuthority')
.its('response.statusCode')
.should('eq', 200)
.wait(100);

cy.get('#plan-characteristics-rulemaking-required')
.should('not.be.disabled')
.check({ force: true })
.should('be.checked');

Expand Down
12 changes: 9 additions & 3 deletions cypress/e2e/collaborator.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ describe('The Collaborator/Team Member Form', () => {

cy.get('#react-select-model-team-cedar-contact-input')
.click()
.type('Jerry{enter}', { delay: 500 })
.should('have.value', 'Jerry Seinfeld, SF13');
.type('Jerry', { delay: 1000 });

cy.get('#react-select-model-team-cedar-contact-option-0')
.contains('Jerry Seinfeld, SF13')
.click();

cy.contains('button', 'Add team member').should('be.disabled');

Expand Down Expand Up @@ -57,7 +60,10 @@ describe('The Collaborator/Team Member Form', () => {

cy.get('input').should('be.disabled');

cy.get('select').select('Model Team').should('have.value', 'MODEL_TEAM');
cy.get('select')
.should('not.be.disabled')
.select('Model Team')
.should('have.value', 'MODEL_TEAM');

cy.contains('button', 'Update team member').click();

Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/discussions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe('Discussion Center', () => {
cy.contains('button', 'Save answer').should('be.disabled');

cy.get('#discussion-content')
.should('not.be.disabled')
.type('Model characteristics is located within the task list.')
.should(
'have.value',
Expand Down
2 changes: 2 additions & 0 deletions cypress/e2e/filterGroups.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ describe('Filter Group in Read Only Sections', () => {
cy.get('#read-only-side-nav__wrapper').should('not.exist');
cy.get('.filtered-view-section--model-team').should('exist');

// Clear filter after viewing the CCW filtered group view

cy.get('[data-testid="group-filter-banner"]').within(() => {
cy.get('button').contains('Clear filter').click();
});
Expand Down
79 changes: 12 additions & 67 deletions cypress/e2e/modelPlan.spec.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
import { aliasQuery } from '../support/graphql-test-utils';
import verifyStatus from '../support/verifyRequestStatus';

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

cy.intercept('POST', '/api/graph/query', req => {
aliasQuery(req, 'GetModelPlan');
aliasQuery(req, 'GetIsCollaborator');
aliasQuery(req, 'GetModelPlanBase');
aliasQuery(req, 'GetModelCollaborators');
aliasQuery(req, 'GetModelPlanInfo');
aliasQuery(req, 'GetBasics');
aliasQuery(req, 'GetMilestones');
aliasQuery(req, 'GetAllModelPlans');
});
});

it('fills out model plan name and creates plan', () => {
Expand All @@ -32,57 +18,38 @@ describe('The Model Plan Form', () => {

cy.contains('button', 'Next').click();

cy.wait([
'@GetIsCollaborator',
'@GetModelPlanBase',
'@GetModelCollaborators'
])
.then(verifyStatus)
.wait(500);

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

cy.get('[data-testid="continue-to-tasklist"]').click();

cy.wait('@GetModelPlan')
.its('response.statusCode')
.should('eq', 200)
.wait(500);
cy.get('[data-testid="page-loading"]').should('not.exist');

cy.contains('h1', 'Model Plan task list');
cy.get('[data-testid="continue-to-tasklist"]').click();

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

cy.contains('h1', 'Model Plan task list');

cy.contains('h3', 'Model basics');

cy.contains('button', 'Start').click();

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

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

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

cy.get('#plan-basics-model-name')
.clear()
.type('Renamed Model Plan Name')
.should('have.value', 'Renamed Model Plan Name');

cy.contains('button', 'Save and return to task list').click();

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

cy.location().should(loc => {
expect(loc.pathname).to.match(/\/models\/.{36}\/task-list/);
});
Expand All @@ -94,10 +61,7 @@ describe('The Model Plan Form', () => {

cy.get('[data-testid="basics"]').click();

cy.wait('@GetModelPlanInfo')
.its('response.statusCode')
.should('eq', 200)
.wait(500);
cy.get('[data-testid="fieldset"]').should('not.be.disabled');

cy.get('#plan-basics-abbreviation').type('RMP').should('have.value', 'RMP');

Expand All @@ -119,17 +83,14 @@ describe('The Model Plan Form', () => {

cy.contains('button', 'Next').click();

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

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

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

cy.get('#ModelType-Voluntary').check({ force: true }).should('be.checked');

cy.get('#ModelType-Problem')
Expand All @@ -149,17 +110,14 @@ describe('The Model Plan Form', () => {

cy.contains('button', 'Next').click();

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

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

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

cy.contains('h3', 'Anticipated high level timeline');

cy.get('#Milestone-completeICIP')
Expand Down Expand Up @@ -202,11 +160,6 @@ describe('The Model Plan Form', () => {

cy.contains('button', 'Save and return to task list').click();

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

cy.location().should(loc => {
expect(loc.pathname).to.match(/\/models\/.{36}\/task-list/);
});
Expand Down Expand Up @@ -240,11 +193,6 @@ describe('The Model Plan Form', () => {
.should('be.not.disabled')
.click();

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

cy.location().should(loc => {
expect(loc.pathname).to.match(/\/models\/.{36}\/task-list/);
});
Expand All @@ -254,10 +202,7 @@ describe('The Model Plan Form', () => {
// favorites and unfavorites a model plan
cy.visit('/models');

cy.wait('@GetAllModelPlans')
.its('response.statusCode')
.should('eq', 200)
.wait(500);
cy.get('[data-testid="page-loading"]').should('not.exist');

cy.contains('tr', 'Empty Plan').get('[data-cy="favorited"]');

Expand Down
Loading