All files / src/app/landing-page/footer footerLinks.js

100% Statements 12/12
100% Branches 6/6
100% Functions 2/2
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64                            5x                     5x                   5x                     5x                       16x 11x 10x 7x    
/**
 * EI-371 — Landing-page footer link constants.
 *
 * Extracted from `Footer.jsx` so the link contract (label + path +
 * id) is unit-testable without rendering React Router.
 *
 * The footer's "Quick Links" section is what Zephyr calls "PAGES" —
 * the names diverged historically.  This file is the source of truth
 * for the link triad: Home / About / Contact.
 *
 * Each link has a stable id (`landing-page-footer-link-<slug>`) so
 * E2E selectors stay valid through any future MUI / styling changes.
 */
 
export const FOOTER_QUICK_LINKS = [
    { label: "Home", path: "/", id: "landing-page-footer-link-home" },
    { label: "About", path: "/about", id: "landing-page-footer-link-about" },
    { label: "Contact", path: "/contact", id: "landing-page-footer-link-contact" },
];
 
/**
 * Convenience accessor for the canonical Home link.  Useful when the
 * caller knows it wants Home specifically and would otherwise have
 * to `.find(...)` on the array.
 */
export const FOOTER_HOME_LINK = FOOTER_QUICK_LINKS.find((l) => l.label === "Home");
 
/**
 * EI-2737 — Enhanced Footer Layout: contact-info entries.
 *
 * Used by the "Contact" footer section.  Each entry is `{ kind, text }`
 * — the FE renders an icon for each `kind` (email / phone / location)
 * + the `text` next to it.  Extracted as data-only constants so the
 * contract is unit-testable without depending on MUI icon components.
 */
export const FOOTER_CONTACT_INFO = [
    { kind: "email", text: "info@eruditiontx.com" },
    { kind: "phone", text: "+1 (555) 123-4567" },
    { kind: "location", text: "Houston, Texas, USA" },
];
 
/**
 * EI-2737 — Social-link entries.  Each has an `aria-label` (required
 * for screen-reader accessibility per WCAG 2.1 SC 4.1.2) and an
 * external `href` that opens in a new tab.
 */
export const FOOTER_SOCIAL_LINKS = [
    { name: "LinkedIn", href: "https://linkedin.com", ariaLabel: "LinkedIn" },
    { name: "Twitter", href: "https://twitter.com", ariaLabel: "Twitter" },
];
 
/**
 * EI-2737 — Resilience helper for navigation links.  Returns `true` if
 * the path looks like a same-origin route the React Router can handle.
 * Defensive: empty / null / non-string / non-leading-slash paths are
 * treated as broken (e.g., a footer link that lost its `to` prop).
 */
export function isValidFooterPath(path) {
    if (typeof path !== "string") return false;
    if (path.length === 0) return false;
    if (!path.startsWith("/")) return false;
    return true;
}