Enforces testing standards for the Eigen codebase, focusing on component and Relay integration testing while avoiding deprecated utilities.
Install
mkdir -p .claude/skills/eigen-testing && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4591" && unzip -o skill.zip -d .claude/skills/eigen-testing && rm skill.zipInstalls to .claude/skills/eigen-testing
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Write and maintain tests for Eigen, a React Native application using React Native Testing Library and Relay Test Utils. Use this skill when writing new tests, fixing failing tests, adding test coverage, updating existing tests, or when asked about testing best practices for Eigen. Triggers on requests like "write tests for this component", "add test coverage", "fix this test", "how should I test this", or any testing-related questions for the Eigen codebase.Key capabilities
- →Write unit tests for React Native components
- →Test Relay-connected components
- →Update test coverage for Eigen
- →Mock analytics tracking events
- →Verify navigation behavior
How it works
The skill enforces a standardized testing structure using React Native Testing Library and Relay Test Utils. It mandates specific file naming conventions and colocation within __tests__ directories to ensure consistent test maintenance.
Inputs & outputs
When to use eigen-testing
- →Write unit tests for React Native components
- →Test Relay-connected components
- →Update test coverage for Eigen
About this skill
Eigen Testing Skill
Use this skill to write high-quality tests for Eigen following established patterns and best practices.
Quick Start
For Non-Relay Components
Use the template at assets/component-test-template.tsx as a starting point:
import { fireEvent, screen } from "@testing-library/react-native"
import { renderWithWrappers } from "app/utils/tests/renderWithWrappers"
For Relay Components
Use the template at assets/relay-test-template.tsx as a starting point:
import { setupTestWrapper } from "app/utils/tests/setupTestWrapper"
import { graphql } from "react-relay"
Critical Rules
- File Location: Always place tests in
__tests__directories colocated with source files - File Naming: Use
.tests.tsx(not.test.tsxor.spec.tsx) - Never Use Deprecated Utilities: Avoid
renderWithWrappersLEGACY,setupTestWrapper_LEGACY,resolveMostRecentRelayOperation,flushPromiseQueue,waitUntil,extractText,renderWithLayout - Analytics Testing: Always use
toMatchInlineSnapshot()pattern for tracking events - Async Operations: Use
findBy*queries, notwaitUntilor promise flushing
Test Structure Pattern
Follow Arrange-Act-Assert:
describe("ComponentName", () => {
it("does something specific", () => {
// Arrange: Set up and render
renderWithWrappers(<Component />)
// Act: Trigger behavior
fireEvent.press(screen.getByTestId("button-id"))
// Assert: Verify outcome
expect(mockNavigate).toHaveBeenCalledWith("/path")
})
})
Common Patterns
Testing Navigation
import { navigate } from "app/system/navigation/navigate"
expect(navigate).toHaveBeenCalledWith("/artwork/artwork-slug")
Testing Analytics
import { mockTrackEvent } from "app/utils/tests/globallyMockedStuff"
expect(mockTrackEvent).toHaveBeenCalledTimes(1)
expect(mockTrackEvent.mock.calls[0]).toMatchInlineSnapshot()
// Run test to generate snapshot, then verify it's correct
Testing Relay Data
renderWithRelay({
Me: () => ({
name: "John Doe",
artworks: {
edges: mockEdges(10), // Use mockEdges for paginated data
},
}),
})
Testing Error States
const { mockRejectLastOperation } = renderWithRelay()
mockRejectLastOperation(new Error("Network error"))
Detailed Guidelines
For comprehensive testing patterns, utilities, and examples, refer to:
- references/testing-guidelines.md - Complete testing documentation
Read this file when you need:
- Detailed examples of testing patterns
- Information about wrapper props and configuration
- Guidance on what to test and what not to test
- Mock helpers and utilities
- Additional resources and links
TestID Conventions
Use descriptive, kebab-case test IDs:
artwork-save-buttonartist-series-list-itemprice-display-container
Running Tests
yarn test # Run all tests
yarn test:watch # Watch mode
yarn test path/to/file.tests.tsx # Test specific file
When not to use it
- →Using deprecated utilities like renderWithWrappersLEGACY
- →Testing non-Eigen codebases
Limitations
- →Requires Eigen codebase structure
- →Strict prohibition on legacy testing utilities
How it compares
This approach enforces strict adherence to Eigen-specific testing patterns and deprecated utility bans, whereas generic testing relies on standard library defaults.
Compared to similar skills
eigen-testing side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| eigen-testing (this skill) | 1 | 6mo | Review | Intermediate |
| react-testing-conventions | 0 | 7mo | No flags | Intermediate |
| claude-mobile-ios-testing | 18 | 9mo | No flags | Intermediate |
| frontend-mobile-development-component-scaffold | 1 | 4mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by artsy
View all by artsy →You might also like
react-testing-conventions
benaor
Testing conventions for React Native with TypeScript. Use this skill when writing tests, reviewing test code, or setting up test infrastructure. Covers unit tests, integration tests, component tests, test doubles (dummy, stub, spy, mock), builder pattern for fixtures, and the testing pyramid.
claude-mobile-ios-testing
krzemienski
Use when testing iOS apps on simulator, capturing screenshots for validation gates, automating UI testing with expo-mcp and xc-mcp, or verifying visual correctness - combines expo-mcp autonomous testing (React Native level) with xc-mcp simulator management (iOS level)
frontend-mobile-development-component-scaffold
sickn33
You are a React component architecture expert specializing in scaffolding production-ready, accessible, and performant components. Generate complete component implementations with TypeScript, tests, s
setup-react-native-storybook
storybookjs
Set up Storybook for React Native in Expo, React Native CLI, or Re.Pack projects. Use when adding Storybook to a project, configuring metro.config.js with withStorybook, creating .rnstorybook configuration files, setting up Storybook routes in Expo Router, configuring getStorybookUI, or adding the StorybookPlugin to a Re.Pack rspack/webpack config. Covers Expo, Expo Router, plain React Native CLI, and Re.Pack setups.
tdd
JubaKitiashvili
Test-driven development workflow with Jest and React Native Testing Library
code_review
Dusuan
titulo: code_review descripcion: Estándares y lista de verificación (checklist) para revisar código de manera segura y eficiente, cubriendo UI, rendimiento y seguridad. ------