rdc-react-testing

Test @data-client/react hooks and components with fixtures and interceptors.

2.0k|99|Updated Feb 15, 2019
One-click install
npx skills add https://github.com/reactive/data-client --skill rdc-react-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rdc-react-testing
Source: https://github.com/reactive/data-client/tree/main/.cursor/skills/rdc-react-testing
Command: npx skills add https://github.com/reactive/data-client --skill rdc-react-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Testing workflow for @data-client/react apps is complex, and this skill provides utilities to validate hooks and components by simulating data flows, fixtures, and interceptors.

Core Features & Use Cases

  • RenderDataHook-based testing for hooks and components
  • Fixtures and interceptors for controlled server responses
  • Component and hook-level test coverage with mock responses

Quick Start

Run a renderDataHook test with initialFixtures to validate a hook's data flow and UI rendering.

Frequently Asked Questions about rdc-react-testing

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

FAQPage Schema
How do I test React data fetching hooks with fixtures and interceptors?

You can test React data fetching hooks by using renderDataHook with initialFixtures to simulate controlled server responses. This approach validates data flows, mutations, and UI rendering without requiring actual network requests.

What is the best way to mock server responses for @data-client/react component tests?

Mocking server responses for @data-client/react component tests is best handled by applying fixtures and interceptors. These utilities provide controlled mock responses to validate UI rendering across normal data flows and error states.

Does this testing approach work for both unit and component tests in React apps?

Yes, this testing approach works for both unit and component tests in React apps. It applies renderDataHook and fixtures to validate hooks and components, successfully covering data-fetching, mutations, and error states.

Can I simulate error states and mutations when testing @data-client/react hooks?

You can simulate error states and mutations when testing @data-client/react hooks. By configuring interceptors and fixtures, you control mock server responses to validate how your hooks handle mutation flows and error conditions.

Why do I need fixtures and interceptors for React hook testing?

Fixtures and interceptors are needed for React hook testing to isolate tests from real network conditions. They provide predictable mock responses, ensuring your data-fetching and mutation tests remain stable and controlled.

Testing @data-client/react hooks not working, what are the limitations?

If testing @data-client/react hooks is not working, ensure your initialFixtures correctly match expected data shapes. A key limitation involves accurately simulating complex interceptor flows, which requires precise mock responses to validate error states properly.