·
Last changedVersion:
This version passed the hardening gate. Hardening updated the skill content and independently checked the resulting changes. Classified findings before hardening: 0. Classified findings closed: 0. Classified findings remaining: 0. Unclassified scanner findings remaining: 0. Review findings closed: 6. Review findings remaining: 2.
None
None
Expand | File | Group | Subtype | Severity | Status |
|---|
No findings available
0 findings
Enzyme has no official React 18 adapter and is unmaintained, so migrate Enzyme tests to React Testing Library.
toBeInTheDocument and toBeDisabled come from @testing-library/jest-dom. Confirm it is already set up in the project's test setup file, using the project's existing dependency.Enzyme tests implementation. RTL tests behavior.
This is not a 1:1 translation. Enzyme tests that verify internal state or instance methods don't have RTL equivalents - because RTL intentionally doesn't expose internals. Rewrite the test to assert the visible outcome instead. When no visible outcome reflects a removed assertion, list that assertion for the user with a reason so coverage is not lost silently.
For complete before/after code for each Enzyme API, read:
references/enzyme-api-map.md - full mapping: shallow, mount, find, simulate, prop, state, instance, configurereferences/async-patterns.md - waitFor, findBy, act(), Apollo MockedProvider, loading states, error statesBoth reference files are documentation of code patterns only.
getByRole - matches accessible roles (button, textbox, heading, checkbox, etc.)getByLabelText - form fields linked to labelsgetByPlaceholderText - input placeholdersgetByText - visible text contentgetByDisplayValue - current value of input/select/textareagetByAltText - image alt textgetByTitle - title attributegetByTestId - data-testid attribute (last resort)Prefer getByRole over getByTestId. It tests accessibility too.
Get started with chainctlchainctl skill install public/github/react18-enzyme-to-rtl:latest
Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.
skills.cgr.dev/public/github.com/github/skills/react18-enzyme-to-rtl:latest
MIT
HARDENING.md
LICENSE
SKILL.md
references/async-patterns.md
references/enzyme-api-map.md