Skip to content

Commit

Permalink
fix(e2e): add a11y routes and fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminpaige committed Jan 30, 2024
1 parent e0fe69e commit 85ecb27
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 12 deletions.
19 changes: 18 additions & 1 deletion src/services/ui/e2e/tests/a11y/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
import { test, expect } from "@playwright/test";
import AxeBuilder from "@axe-core/playwright";

const staticRoutes = ["/", "/dashboard", "/faq", "/profile"];
const staticRoutes = [
"/",
"/dashboard",
"/faq",
"/profile",
"/new-submission",
"/new-submission/spa",
"/new-submission/spa/medicaid",
"/new-submission/spa/chip",
"/new-submission/waiver",
"/new-submission/waiver/b",
"/new-submission/waiver/b/b4",
"/new-submission/waiver/b/capitated",
"/new-submission/spa/medicaid/landing/medicaid-abp",
"/new-submission/spa/medicaid/landing/medicaid-eligibility",
"/new-submission/spa/chip/landing/chip-eligibility",
];

test.describe("test a11y on static routes", () => {
for (const route of staticRoutes) {
Expand All @@ -21,6 +37,7 @@ test.describe("test a11y on static routes", () => {
});

const webformRoutes = [
"/webforms",
"/guides/abp",
"/webform/abp10/1",
"/webform/abp3_1/1",
Expand Down
6 changes: 3 additions & 3 deletions src/services/ui/src/components/Inputs/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const Upload = ({ maxFiles, files, setFiles }: UploadProps) => {
className="flex border-2 rounded-md py-1 pl-2.5 pr-1 border-sky-500 items-center"
key={file.name}
>
<span className="text-sky-500">{file.name}</span>
<span className="text-sky-700">{file.name}</span>
<I.Button
onClick={(e) => {
e.preventDefault();
Expand All @@ -60,7 +60,7 @@ export const Upload = ({ maxFiles, files, setFiles }: UploadProps) => {
variant="ghost"
className="p-0 h-0"
>
<X className="ml-2 text-sky-500 w-5" />
<X className="ml-2 text-sky-700 w-5" />
</I.Button>
{/* </div> */}
</div>
Expand All @@ -76,7 +76,7 @@ export const Upload = ({ maxFiles, files, setFiles }: UploadProps) => {
>
<p>
Drag file here or{" "}
<span className="text-sky-500 underline hover:cursor-pointer">
<span className="text-sky-700 underline hover:cursor-pointer">
choose from folder
</span>
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const ReviewTeamList = ({ team }: { team: string[] | undefined }) => {
<li key={`reviewteam-ul-${reviewer}-${idx}`}>{reviewer}</li>
))}
{team && team?.length > 3 && (
<li className={"text-xs text-sky-600 hover:cursor-pointer"}>
<li className={"text-xs text-sky-700 hover:cursor-pointer"}>
<button onClick={() => setExpanded((prev) => !prev)}>
{expanded ? "Show less" : "Show more"}
</button>
Expand Down
1 change: 0 additions & 1 deletion src/services/ui/src/components/Routing/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const MEDICAID_ELIGIBILITY_LANDING =
"/new-submission/spa/medicaid/landing/medicaid-eligibility";
export const CHIP_ELIGIBILITY_LANDING =
"/new-submission/spa/chip/landing/chip-eligibility";
export const CREATE = "/create";
export const MEDICAID_NEW = "/new-submission/spa/medicaid/create";
export const CHIP_NEW = "/new-submission/spa/chip/create";
export const WEBFORMS = "/webforms";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const FAQHelperText = () => (
For additional information on where to submit, refer to the{" "}
{/* TODO: Get desired FAQ `target` from Wale */}
<Link
className="text-sky-600 hover:text-sky-800 underline"
className="text-sky-700 hover:text-sky-800 underline"
target={FAQ_TAB}
path="/faq"
hash={"system"}
Expand Down Expand Up @@ -65,7 +65,9 @@ const ExternalAppLandingPage = ({
{image}
{description}
<a className="mb-8" href={buttonLink} target="_blank" rel="noreferrer">
<Button className="landing-button">{buttonLabel}</Button>
<Button className="landing-button" aria-label={buttonLabel}>
{buttonLabel}
</Button>
</a>
<FAQHelperText />
</div>
Expand All @@ -86,7 +88,7 @@ export const MedicaidABPLandingPage = () => (
Medicaid Alternative Benefits Plans (ABP), and Medicaid Premiums and
Cost Sharing are managed within the{" "}
<a
className="text-sky-600 hover:text-sky-800 underline"
className="text-sky-700 hover:text-sky-800 underline"
href={EXTERNAL_APP.MMDL}
target="_blank"
rel="noreferrer"
Expand Down Expand Up @@ -121,7 +123,7 @@ export const MedicaidEligibilityLandingPage = () => (
Medicaid Eligibility, Enrollment, Administration, and Health Homes
SPA packages are submitted within the{" "}
<a
className="text-sky-600 hover:text-sky-800 underline"
className="text-sky-700 hover:text-sky-800 underline"
href={EXTERNAL_APP.MAC_PRO}
target="_blank"
rel="noreferrer"
Expand Down Expand Up @@ -152,7 +154,7 @@ export const CHIPEligibilityLandingPage = () => (
<b>
CHIP Eligibility SPAs are managed within the{" "}
<a
className="text-sky-600 hover:text-sky-800 underline"
className="text-sky-700 hover:text-sky-800 underline"
href={EXTERNAL_APP.MMDL}
target="_blank"
rel="noreferrer"
Expand Down
2 changes: 1 addition & 1 deletion src/services/ui/src/pages/detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const PackageActionsCard = ({ id }: { id: string }) => {
key={`${idx}-${type}`}
path="/action/:id/:type"
params={{ id, type }}
className="text-sky-500 underline"
className="text-sky-700 underline"
>
<li>{mapActionLabel(type)}</li>
</Link>
Expand Down

0 comments on commit 85ecb27

Please sign in to comment.