Skip to content

test(components): cover Footer nav, external rel, and dynamic year#217

Merged
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
yunus-dev-codecrafter:test/testing-footer
Jun 29, 2026
Merged

test(components): cover Footer nav, external rel, and dynamic year#217
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
yunus-dev-codecrafter:test/testing-footer

Conversation

@yunus-dev-codecrafter

Copy link
Copy Markdown

closes #149


## Summary

Adds comprehensive test coverage for the `Footer` component, covering internal nav links, external Discord link safety attributes, and the dynamic copyright year with a mocked `Date`.

## Changes

### `src/components/__tests__/Footer.test.tsx`

- **Footer landmark & tagline** — asserts `<footer role="contentinfo">` renders and the tagline text is present.
- **Internal navigation links** — validates the `<nav aria-label="Footer">` landmark contains four `<Link>` elements (About, Docs, Changelog, Stats) with correct `href` attributes and no `target`/`rel`.
- **Route resolution** — verifies every internal link target resolves to an existing route under `src/app/`.
- **External Discord link safety** — ensures the Discord `<a>` tag carries `target="_blank"` and `rel="noopener noreferrer"`.
- **Dynamic copyright year** — freezes `Date` with `jest.useFakeTimers()` and asserts the copyright line shows the expected year.

### `jest.config.ts`

- Added per-file coverage threshold for `./src/components/Footer.tsx` at 100% across all metrics to prevent regressions.

## Test Results

PASS src/components/tests/Footer.test.tsx
Footer
✓ renders the footer landmark and tagline
✓ renders the navigation landmark with internal links
✓ validates each internal link target resolves to an existing route under src/app
✓ renders the external Discord link safely
✓ renders the dynamic copyright year

File | % Stmts | % Branch | % Funcs | % Lines
Footer.tsx | 100 | 100 | 100 | 100


**Coverage:** 100% on `Footer.tsx` — all statements, branches, functions, and lines covered.

@mikewheeleer

Copy link
Copy Markdown
Contributor

clean diff — merging now

@mikewheeleer mikewheeleer merged commit 32d5098 into Agentpay-Org:main Jun 29, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for the Footer navigation, Discord link, and dynamic year

2 participants