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

Ad/4211 MMIS APD overview #4528

Merged
merged 46 commits into from Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
ce93273
apd overview updated for multiple apd types, add apd overview mmis fi…
amyd11 Jan 26, 2023
41371d6
implements mapping for label values
amyd11 Jan 27, 2023
52461f6
add unit testing
amyd11 Jan 27, 2023
91dd272
name validation wip
amyd11 Jan 30, 2023
67a97cd
merge main branch in
amyd11 Jan 31, 2023
0baf1fd
finish resolving merge conflicts
amyd11 Jan 31, 2023
d2ac319
validation message
amyd11 Jan 31, 2023
de15da3
name validation
amyd11 Jan 31, 2023
e2cc344
cypress testing
amyd11 Feb 1, 2023
3a1b8dd
small changes to form error handling
amyd11 Feb 2, 2023
75030e1
create selectors; update schema
amyd11 Feb 3, 2023
ca400ce
fix error message display
amyd11 Feb 6, 2023
2ac5b3f
enforce whitespace validation for text field
amyd11 Feb 6, 2023
74b78ba
update schema, remove selectors, cleanup
amyd11 Feb 6, 2023
30334d0
testing
amyd11 Feb 7, 2023
38de0d7
resolve merge conflicts
amyd11 Feb 7, 2023
e8f2181
resolve lint errors
amyd11 Feb 7, 2023
afe93c4
update snapshot
amyd11 Feb 7, 2023
5bb4be2
update text in test
amyd11 Feb 7, 2023
b8e5ad9
Merge branch 'main' into ad/4211-mmis-apd-overview
amyd11 Feb 7, 2023
a23e741
attempt to resolve backend test
amyd11 Feb 7, 2023
8efa983
remove unused value
amyd11 Feb 7, 2023
b3ac668
scoped year checkbox assertions in e2e tests
amyd11 Feb 8, 2023
ab0bc27
upate error message text
amyd11 Feb 8, 2023
cc9e15a
add test for redux action
amyd11 Feb 8, 2023
893e0de
Merge branch 'main' into ad/4211-mmis-apd-overview
amyd11 Feb 8, 2023
5faf0c4
cleanup
amyd11 Feb 8, 2023
3fba51d
Merge branch 'main' into ad/4211-mmis-apd-overview
amyd11 Feb 9, 2023
a0e8566
Merge branch 'main' into ad/4211-mmis-apd-overview
amyd11 Feb 9, 2023
42f74bc
add apd update field to overview for hitech and mmis types
amyd11 Feb 14, 2023
73fbfe3
update backend tests, add redux action test
amyd11 Feb 14, 2023
fd0e371
add testing; update seed data
amyd11 Feb 15, 2023
e03671e
Merge branch 'main' into ad/4211-mmis-apd-overview
amyd11 Feb 15, 2023
2df842d
test update; resolve console warnings
amyd11 Feb 15, 2023
b11bf53
add testing; fix test change
amyd11 Feb 15, 2023
3452695
cypress testing refinement
amyd11 Feb 15, 2023
3942199
styling display updates
amyd11 Feb 16, 2023
eb76c9a
add test for addition to Instruction component
amyd11 Feb 16, 2023
83d20e0
update snapshots for new Instruction prop
amyd11 Feb 16, 2023
b8d8a53
lint fix
amyd11 Feb 16, 2023
ae35716
Merge branch 'main' into ad/4211-mmis-apd-overview
amyd11 Feb 16, 2023
e8c2ffa
Merge branch 'main' into ad/4211-mmis-apd-overview
amyd11 Feb 17, 2023
82cea49
Merge branch 'main' into ad/4211-mmis-apd-overview
amyd11 Feb 17, 2023
dd0f2b3
Merge branch 'main' into ad/4211-mmis-apd-overview
amyd11 Feb 21, 2023
e9ccab1
merge main branch in and resolve conflict
amyd11 Feb 23, 2023
2e87ebc
Merge branch 'main' into ad/4211-mmis-apd-overview
amyd11 Feb 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/util/adminCheck.js
Expand Up @@ -70,6 +70,7 @@ const buildErrorList = (validationResults, apdId, activityIndexes) => {

const getSectionName = errorPath => {
const sectionNameDict = {
name: 'APD Overview',
apdOverview: 'APD Overview',
keyStatePersonnel: 'Key State Personnel',
statePrioritiesAndScope: 'State Priorities and Scope',
Expand Down Expand Up @@ -115,6 +116,7 @@ const buildErrorList = (validationResults, apdId, activityIndexes) => {

const getURLPath = errorPath => {
const sectionURLPath = {
name: 'apd-overview',
apdOverview: 'apd-overview',
keyStatePersonnel: 'state-profile',
statePrioritiesAndScope: 'state-priorities-and-scope',
Expand Down
7 changes: 6 additions & 1 deletion api/util/adminCheck.test.js
Expand Up @@ -2135,7 +2135,7 @@ const expectedErrorsMockMmisApdRandom = [
{
section: 'APD Overview',
link: '/apd/632a0fbc5665670a34b3bbd7/apd-overview',
fieldDescription: 'Provide another Medicaid Business Area(s)'
fieldDescription: 'Provide Other Medicaid Business Area(s).'
},
{
section: 'Key State Personnel',
Expand Down Expand Up @@ -2539,6 +2539,11 @@ tap.test('MMIS apd document admin check', async mmisValidationTests => {
section: 'APD Overview',
link: '/apd/632a0fbc5665670a34b3bbd7/apd-overview',
fieldDescription: 'Select yes or no'
},
{
section: 'APD Overview',
link: '/apd/632a0fbc5665670a34b3bbd7/apd-overview',
fieldDescription: 'Select at least one Medicaid Business Area.'
}
]);
}
Expand Down
12 changes: 6 additions & 6 deletions common/schemas/apdNew.js
Expand Up @@ -54,18 +54,18 @@ const apdNewSchema = Joi.object({
businessList: Joi.when('apdType', {
is: APD_TYPE.MMIS,
then: Joi.array().min(1).required().messages({
'array.min': 'Provide an other Medicaid Business Area(s)',
'any.only': 'Provide an other Medicaid Business Area(s)',
'any.required': 'Provide an other Medicaid Business Area(s)'
'array.min': 'Provide Other Medicaid Business Area(s)',
'any.only': 'Provide Other Medicaid Business Area(s)',
'any.required': 'Provide Other Medicaid Business Area(s)'
}),
otherwise: Joi.any()
}),
otherDetails: Joi.when('businessList', {
is: Joi.array().items(Joi.string()).has(Joi.string().valid('other')),
then: Joi.string().min(1).required().messages({
'string.empty': 'Provide an other Medicaid Business Area(s)',
'any.required': 'Provide an other Medicaid Business Area(s)',
'any.only': 'Provide any other Medicaid Business Area(s)'
'string.empty': 'Provide Other Medicaid Business Area(s)',
'any.required': 'Provide Other Medicaid Business Area(s)',
'any.only': 'Provide Other Medicaid Business Area(s)'
}),
otherwise: Joi.any()
})
Expand Down
46 changes: 41 additions & 5 deletions common/schemas/apdOverview.js
Expand Up @@ -22,6 +22,21 @@ const updateStatusSchema = Joi.object({
'object.missing': 'Select an update type'
});

export const apdNameSchema = Joi.string()
.pattern(/^((?!untitled).)*$/i)
.min(1)
.required()
.messages({
'any.required': 'Provide an APD name.',
'string.empty': 'Provide an APD name.',
'string.base': 'Provide an APD name.',
'string.pattern.base': 'APD name cannot contain "untitled".'
});

export const sharedApdOverviewFields = Joi.object({
name: apdNameSchema
});

export const hitechOverviewSchema = Joi.object({
updateStatus: updateStatusSchema,
// Funding sources is not a user input but we use this as a dependency for
Expand Down Expand Up @@ -78,14 +93,35 @@ export const medicaidBusinessAreasSchema = Joi.object({
other: Joi.boolean(),
otherMedicaidBusinessAreas: Joi.when('other', {
is: true,
then: Joi.string().min(1).required().messages({
'string.base': 'Provide another Medicaid Business Area(s)',
'string.empty': 'Provide another Medicaid Business Area(s)',
'string.required': 'Provide another Medicaid Business Area(s)'
then: Joi.string().trim().min(1).required().messages({
'string.base': 'Provide Other Medicaid Business Area(s).',
'string.empty': 'Provide Other Medicaid Business Area(s).',
'string.required': 'Provide Other Medicaid Business Area(s).'
}),
otherwise: Joi.any()
})
}).or('waiverSupportSystems', 'assetVerificationSystem');
})
.or(
'waiverSupportSystems',
'assetVerificationSystem',
'claimsProcessing',
'decisionSupportSystemDW',
'electronicVisitVerification',
'encounterProcessingSystemMCS',
'financialManagement',
'healthInformationExchange',
'longTermServicesSupports',
'memberManagement',
'pharmacyBenefitManagementPOS',
'programIntegrity',
'providerManagement',
'thirdPartyLiability',
'other',
{ isPresent: resolved => resolved === true }
)
.messages({
'object.missing': 'Select at least one Medicaid Business Area.'
});

export const mmisOverviewSchema = Joi.object({
updateStatus: updateStatusSchema,
Expand Down
11 changes: 3 additions & 8 deletions common/schemas/combined.js
Expand Up @@ -2,6 +2,7 @@ import Joi from 'joi';

import {
// activitiesDashboard,
apdNameSchema,
hitechOverviewSchema,
mmisOverviewSchema,
keyStatePersonnelSchema,
Expand Down Expand Up @@ -39,10 +40,7 @@ export const hitechCombinedSchema = Joi.object({
}),
status: Joi.any(),
stateId: Joi.any(),
name: Joi.string().messages({
'string.base': 'Provide an APD name',
'string.empty': 'Provide an APD name'
}),
name: apdNameSchema,
years: Joi.any(),
yearOptions: Joi.any(),
apdOverview: hitechOverviewSchema,
Expand Down Expand Up @@ -102,10 +100,7 @@ export const mmisCombinedSchema = Joi.object({
}),
status: Joi.any(),
stateId: Joi.any(),
name: Joi.string().messages({
'string.base': 'Provide an APD name',
'string.empty': 'Provide an APD name'
}),
name: apdNameSchema,
years: Joi.any(),
yearOptions: Joi.any(),
apdOverview: mmisOverviewSchema,
Expand Down
7 changes: 6 additions & 1 deletion common/schemas/index.js
@@ -1,4 +1,9 @@
export { hitechOverviewSchema, mmisOverviewSchema } from './apdOverview.js';
export {
apdNameSchema,
hitechOverviewSchema,
mmisOverviewSchema,
sharedApdOverviewFields
} from './apdOverview.js';
export {
default as keyStatePersonnelSchema,
medicaidDirectorSchema,
Expand Down
21 changes: 21 additions & 0 deletions common/utils/constants.js
Expand Up @@ -3,3 +3,24 @@ export const APD_TYPE = {
HITECH: 'HITECH',
MMIS: 'MMIS'
};

export const MEDICAID_BUSINESS_AREAS_DISPLAY_LABEL_MAPPING = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great idea for reusability

waiverSupportSystems: '1115 or Waiver Support Systems',
assetVerificationSystem: 'Asset Verification System',
claimsProcessing: 'Claims Processing',
decisionSupportSystemDW: 'Decision Support System & Data Warehouse',
electronicVisitVerification: 'Electronic Visit Verification (EVV)',
encounterProcessingSystemMCS:
'Encounter Processing System (EPS) & Managed Care System',
financialManagement: 'Financial Management',
healthInformationExchange: 'Health Information Exchange (HIE)',
longTermServicesSupports: 'Long Term Services & Supports (LTSS)',
memberManagement: 'Member Management',
pharmacyBenefitManagementPOS:
'Pharmacy Benefit Management (PBM) & Point of Sale (POS)',
programIntegrity: 'Program Integrity',
providerManagement: 'Provider Management',
thirdPartyLiability: 'Third Party Liability (TPL)',
other: 'Other',
otherMedicaidBusinessAreas: 'Other Medicaid Business Area(s)'
};
19 changes: 8 additions & 11 deletions e2e/cypress/helpers/apd/apd-overview.js
Expand Up @@ -174,19 +174,16 @@ export const testDefaultMmisAPDOverview = function () {
cy.findByRole('radio', { name: /MMIS IAPD/i }).should('be.checked');
cy.findByRole('radio', { name: /HITECH IAPD/i }).should('not.be.checked');

cy.get('[type="checkbox"]').each(($year, index, list) => {
if (index === list.length - 1) {
cy.wrap($year).should('not.be.checked');
} else {
cy.wrap($year).should('be.checked');
}
cy.get('[data-cy=yearList]').within(() => {
cy.get('[type="checkbox"]').each(($year, index, list) => {
if (index === list.length - 1) {
cy.wrap($year).should('not.be.checked');
} else {
cy.wrap($year).should('be.checked');
}
});
});

cy.get('[id="program-introduction-field"]').should('have.value', '');
cy.get('[id="hit-overview-field"]').should('have.value', '');
cy.get('[id="hie-overview-field"]').should('have.value', '');
cy.get('[id="mmis-overview-field"]').should('have.value', '');

cy.waitForSave();
});
};
Expand Down
64 changes: 56 additions & 8 deletions e2e/cypress/integration/02-apd/01-apd-basics.cy.js
Expand Up @@ -72,9 +72,10 @@ describe('APD Basics', { tags: ['@apd', '@default'] }, function () {
});

describe('Create APD', function () {
it('creates a default new APD and handles changing the name and summary', function () {
it('checks fields on newly created APD', function () {
const options = { month: 'long', day: 'numeric', year: 'numeric' };
const today = new Date();
const title = 'HITECH IAPD';

cy.get('#apd-header-info').contains(
`Created: ${today.toLocaleDateString('en-us', options)}`
Expand All @@ -84,17 +85,32 @@ describe('APD Basics', { tags: ['@apd', '@default'] }, function () {
`Created: ${today.toLocaleDateString('en-us', options)}`
);

cy.log('change the APD name');
// APD Header
cy.get(`[data-cy='apd-name-header']`).contains(`${title}`);

// APD Summary text box
cy.findByLabelText('APD Name').should('have.value', `${title}`);

cy.get('[type="checkbox"][checked]').should('have.length', 2);

cy.get('[id="program-introduction-field"]').should('have.value', '');
});
});

describe('APD Name', function () {
it('Allows APD name to be changed', function () {
const title1 = 'HITECH IAPD';
const title2 = 'My Awesome eAPD';
const title3 = 'Magnus Archive Project';

cy.get('#apd-title-input').contains(`${title1}`);
cy.get(`[data-cy='apd-name-header']`).contains(`${title1}`);

// Change name in APD Summary text box
cy.findByLabelText('APD Name').clear().type(`${title2}`).blur();
cy.findByLabelText('APD Name').should('have.value', `${title2}`);

cy.get('#apd-title-input').contains(`${title2}`).click();
// APD name in Header reflects change
cy.get(`[data-cy='apd-name-header']`).contains(`${title2}`).click();

// Change name via APD Header
cy.focused()
Expand All @@ -103,7 +119,9 @@ describe('APD Basics', { tags: ['@apd', '@default'] }, function () {
.type(`${title3}`)
.blur();

cy.get('#apd-title-input').contains(`${title3}`);
// APD name in Summary text box reflects change
cy.get(`[data-cy='apd-name-header']`).contains(`${title3}`);
cy.findByLabelText('APD Name').should('have.value', `${title3}`);

// Change name by clicking EDIT button
cy.get('#title-edit-link').click();
Expand All @@ -114,10 +132,40 @@ describe('APD Basics', { tags: ['@apd', '@default'] }, function () {
.type(`${title2}`)
.blur();

cy.get('#apd-title-input').contains(`${title2}`);
cy.get('[type="checkbox"][checked]').should('have.length', 2);
cy.get(`[data-cy='apd-name-header']`).contains(`${title2}`);
});
it('Validates APD Name', function () {
const untitledName = 'Untitled APD';
const untitledErrorMessage = 'APD name cannot contain "untitled".';
const newName = 'Project of the Ages';

cy.get('[id="program-introduction-field"]').should('have.value', '');
// Clear the existing APD Name and see that the field populates with Untitled APD name
cy.goToApdOverview();
cy.findByLabelText('APD Name').clear().blur();
cy.findByLabelText('APD Name').should('have.value', `${untitledName}`);

// Check validation error in admin check
cy.turnOnAdminCheck();
cy.get('[class="eapd-admin-check-list"]').within(list => {
cy.get(list).contains('APD Overview').should('exist');
cy.get(list).contains(untitledErrorMessage).should('exist');
});
cy.collapseAdminCheck();

// Check validation error in form field
cy.goToApdOverview();
cy.contains(untitledErrorMessage).should('exist');

// Change name to see error removed from form field
cy.findByLabelText('APD Name').clear().type(`${newName}`).blur();
cy.findByLabelText('APD Name').should('have.value', `${newName}`);
cy.contains(untitledErrorMessage).should('not.exist');

// Check validation error removed from admin check
cy.expandAdminCheck();
cy.get('[class="eapd-admin-check-list"]').within(list => {
cy.get(list).contains(untitledErrorMessage).should('not.exist');
});
});
});

Expand Down