gen-rtl-test

Generate React Testing Library unit tests for OpenShift Console components.

459|737|Updated Apr 13, 2018
One-click install
npx skills add https://github.com/openshift/console --skill gen-rtl-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gen-rtl-test
Source: https://github.com/openshift/console/tree/main/.claude/skills/gen-rtl-test
Command: npx skills add https://github.com/openshift/console --skill gen-rtl-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill standardizes the creation of React Testing Library tests for the OpenShift Console, ensuring consistent, accessible, user-centric tests that align with project guidelines.

Core Features & Use Cases

  • Establishes co-located test structure, ES6 imports, and screen-based queries to improve reliability and maintainability.
  • Enforces accessibility-first practices, 5-10 focused tests per component, and avoidance of brittle snapshot tests.
  • Provides a clear Quick Start to generate RTL tests for modified components and ensure consistent test quality across the codebase.

Quick Start

Create RTL tests for changed components using the project's standardized guidelines.

Frequently Asked Questions about gen-rtl-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate React Testing Library unit tests for OpenShift Console components?

You generate React Testing Library unit tests by identifying modified OpenShift Console components and creating co-located test files that follow established RTL best practices, ensuring consistent and accessible user-centric tests across the codebase.

What are the best practices for writing RTL tests for OpenShift Console components?

RTL best practices for OpenShift Console components include using ES6 imports, screen-based queries, and accessibility-focused patterns. You should maintain 5-10 focused tests per component, use verifyInputField for form fields, and avoid brittle snapshot tests.

Can I use snapshot testing when writing React Testing Library tests for OpenShift Console?

No, snapshot testing is discouraged for OpenShift Console components. Instead, you should write 5-10 focused tests per component leveraging accessibility-focused patterns and screen-based queries to ensure reliable and maintainable tests.

How does the accessibility-focused testing approach work with React Testing Library?

Accessibility-focused testing with React Testing Library works by using screen-based queries that reflect how users interact with the UI. This approach enforces ES6 imports and standardizes form field testing with verifyInputField to ensure components are testable.

Do I need Jest to run React Testing Library tests for OpenShift Console components?

Yes, Jest is required as the underlying test runner for executing React Testing Library unit tests. The generated tests integrate with Jest to validate OpenShift Console components while adhering to standardized project guidelines.