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

Ad/4211 MMIS APD overview #4528

merged 46 commits into from Feb 23, 2023

Conversation

amyd11
Copy link
Contributor

@amyd11 amyd11 commented Feb 7, 2023

Resolves #4211

Description

  • Updating APD Overview to allow an MMIS APD type. This includes removing fields specific to HITECH and adding a field specific to MMIS
  • Addition of APD Update field to APD Overview page
  • Adds validation to APD Name

Significant changes or possible side effects

  • Schema updates:
    • MMIS medicaidBusinessAreas tweaking for validation purposes
    • APD Name schema includes ensuring the name does not contain "untitled"
    • APD Update schema created for each of MMIS and HITECH since the validations differ
  • Redux action additions:
    • action to update a key value pair in the medicaidBusinessAreas object
    • action to update a key value pair in the updateStatus object
  • Component changes:
    • Set up APD Name in ApdOverview to be handled within react hook form for validation purposes
    • Modified ApdOverview to contain only the shared fields of HITECH and MMIS APDs. Subsequently moved HITECH fields to new component called ApdOverviewHITECHFields and created ApdOverviewMMISFields for the MMIS fields.
    • Created ApdUpdate component to handle displaying the Update APD section differently for MMIS and HITECH types
    • Added disableTitleCaseConversion prop to the Instruction component
  • Backend
    • Added APD Name validation to fall under APD Overview in Admin Check
  • Misc
    • Created a constant for mapping Medicaid Business Areas key names to labels
    • Updated seed data for invalid and valid options regarding updateStatus field
    • Updated label sizing for fields on APD Overview page
    • Resolved some existing console warnings for "APD Type" field by adding name and label props. Since the code was written with the intent of the label being hidden, a labelClassName prop was also passed in to include a newly added hidden-display style class which hides the label

Automated test cases written

Given When Then Type (jest, tap, cypress)
APD Name with Admin Check ON Name contains "untitled" Validation error appears on the field and in admin check Cypress
APD Name Previous data exists for name Displays previous data in the APD Name field Jest
MMIS APD Overview medicaid business areas No option selected Validation error appears on the field and in admin check Cypress
MMIS APD Overview medicaid business areas "Other" option selected, but "Other Medicaid Business Areas" text box is empty Validation error appears on the field and in admin check Cypress
MMIS APD Overview medicaid business areas with Admin Check ON Form errors are active Validation error also appears in admin check Cypress
MMIS Medicaid Business Areas Previous data exists Displays checkbox as selected or unselected based on existing data Jest
MMIS Medicaid Business Areas "Other" option is checked "Other Medicaid Business Area(s)" text area and content displays Jest
MMIS Medicaid Business Areas "Other" option is NOT checked "Other Medicaid Business Area(s)" text area is NOT visible Jest
HITECH APD Overview Each of the text fields Allows text changes Jest
APD Update in APD Overview HITECH type Displays "Update Type" checkbox options Jest & Cypress
APD Update in APD Overview MMIS type Displays "Is this an APD update?" radio options Jest & Cypress
MMIS APD Overview APD Update field "Yes, it is an update." radio option is selected "Update Type" options available Jest & Cypress
APD Overview APD Update field with Admin Check ON "Update Type" options are all unchecked Validation error appears on the field and in admin check Cypress
Instruction component default behavior for heading heading is converted to title case Jest
Instruction component disableTitleCaseConversion is passed in original heading text appears as is (NOT converted to title case) Jest
APD edit actions for Medicaid Business Areas setBusinessAreaField is called redux dispatches an action for changing the field value unit test

Steps to verify changes

With admin check ON

  1. Open an existing MMIS APD
  2. Go to APD Overview
  3. Test APD Name
    1. Modify the APD name (try including "untitled" in the name) to ensure that errors display both on the form AND in admin check
    2. Modify the APD name from the APD Header and ensure that the name changes reflect within the APD Overview form and that validation errors accurately change on the form.
  4. Test APD Update
    1. Select "Yes, it is an update."
    2. Ensure that the "Update Type" section only appears when "Yes, it is an update." is selected.
    3. Ensure error to "Select an update type." appears in admin check and on the form.
    4. Ensure error disappears when either an update type is selected or the radio button choice is switched to "No, this is for a new project."
  5. Test Medicaid Business Areas
    1. Unselect any checked Medicaid Business Areas to ensure the validation error requiring a selection display both on the form AND in admin check
    2. Select "Other" checkbox in Medicaid Business Areas to ensure a text box appears for "Other Medicaid Business Areas". Check that validation error for text box displays when empty (both on the form AND in admin check)

With admin check OFF

  1. Go to an existing MMIS APD
  2. Ensure that none of the validation errors appear on the form

Other testing

  1. HITECH APD Overview
    1. Regression testing
    2. Update Type field displays
    3. With admin check on, ensure error to "Select an update type." appears in admin check and on the form

This pull request is ready to code review when

  • Automated tests are updated (and all tests are passing)
  • New automated test cases are documented above
  • Pull request has been labeled, if applicable with feature, content, bug,
    tests, refactor
  • The experience passes a basic manual accessibility audit (keyboard nav,
    screenreader, text scaling) OR an exemption is documented

This pull request is ready to test when

  • Code has been reviewed by someone other than the original author

This pull request is ready to review when the QA has

  • Verified the functionality related to the change
  • Verified that the change works with Narrator on Windows
  • Verified that the change works with VoiceOver on Mac
  • Verified all updated pages with the WAVE tool
  • Verified tab and keyboard navigation functionality

This pull request can be merged when

  • Design has approved the experience
  • Product has approved the experience

@amyd11 amyd11 self-assigned this Feb 7, 2023
@codecov
Copy link

codecov bot commented Feb 7, 2023

Codecov Report

Merging #4528 (2e87ebc) into main (d48a75a) will increase coverage by 0.10%.
The diff coverage is 99.43%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4528      +/-   ##
==========================================
+ Coverage   93.94%   94.04%   +0.10%     
==========================================
  Files         252      256       +4     
  Lines        7977     8111     +134     
  Branches     1705     1724      +19     
==========================================
+ Hits         7494     7628     +134     
  Misses        461      461              
  Partials       22       22              
Impacted Files Coverage Δ
web/src/layout/header/ApdHeader.js 93.10% <ø> (ø)
web/src/components/ApdUpdate.js 97.29% <97.29%> (ø)
common/utils/constants.js 100.00% <100.00%> (ø)
e2e/cypress/helpers/apd/apd-name.js 100.00% <100.00%> (ø)
e2e/cypress/helpers/apd/apd-overview.js 100.00% <100.00%> (ø)
web/src/components/Instruction.js 100.00% <100.00%> (ø)
web/src/pages/apd/apd-overview/ApdOverview.js 95.16% <100.00%> (+0.56%) ⬆️
.../pages/apd/apd-overview/ApdOverviewHITECHFields.js 100.00% <100.00%> (ø)
...rc/pages/apd/apd-overview/ApdOverviewMMISFields.js 100.00% <100.00%> (ø)
web/src/redux/actions/editApd/overview.js 100.00% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d48a75a...2e87ebc. Read the comment docs.

@@ -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

import ApdOverviewMMISFields from './ApdOverviewMMISFields';
import DeleteModal from '../../../components/DeleteModal';

const renderApdTypeSpecificFields = apdType => {
Copy link
Contributor

Choose a reason for hiding this comment

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

great way to handle switching between components

Copy link
Contributor

Choose a reason for hiding this comment

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

agreed. this is cleaner than the ternary way

web/src/pages/apd/apd-overview/ApdOverview.js Outdated Show resolved Hide resolved
api/util/adminCheck.test.js Outdated Show resolved Hide resolved
@amyd11 amyd11 added the feature PR label for release log label Feb 7, 2023
@amyd11 amyd11 changed the title [Feature] Ad/4211 MMIS APD overview Ad/4211 MMIS APD overview Feb 7, 2023
})
.or('annualUpdate', 'asNeededUpdate')
.custom(updateStatusCustomValidation)
Copy link
Contributor

Choose a reason for hiding this comment

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

🧠

@mirano-darren
Copy link
Contributor

Looks good to me! Nice work with the APD Name validation 😄
Test Cases:

Given When Then Result
APD Type Field On the APD Overview page This field cannot be changed and should be grayed out
An invalid APD Name blurring out of the field the error message will appear whether adminCheck is on or off
APD Overview Page Admin check is on If field is blank, inline validation should appear. Refer to this dev ticket for error language: #4209
APD Overview Page Right after creating a new APD Green header should appear on the page informing the user they successfully created an APD. Header should only appear after first creating an APD.
APD Overview Page Right after creating a new APD Selections should be the same from the Create new APD page
APD Overview Page Clicking the Continue button Should redirect you to the state scope and priorities page (out of scope of this ticket)

Copy link

@SGilliamA1M SGilliamA1M left a comment

Choose a reason for hiding this comment

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

Changes look good

@amyd11 amyd11 merged commit 1bef861 into main Feb 23, 2023
@amyd11 amyd11 deleted the ad/4211-mmis-apd-overview branch February 23, 2023 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature PR label for release log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dev] Implement MMIS APD Overview
7 participants