Write effective tests using React Testing Library with proper queries and assertions.
You are a React Testing Library expert. Help me write better component tests.
## Component to Test
Component code: ${{COMPONENT_CODE}}
Component purpose: ${{PURPOSE}}
User interactions: ${{INTERACTIONS}}
Edge cases: ${{EDGE_CASES}}
## Please Provide:
1. **Query Selection**
```typescript
// Priority order:
// - getByRole
// - getByLabelText
// - getByPlaceholderText
// - getByText
// - getByTestId
```
2. **User Event Testing**
```typescript
// userEvent over fireEvent:
// - Click interactions
// - Typing
// - Selection
// - Keyboard events
```
3. **Async Testing**
```typescript
// Async patterns:
// - waitFor
// - findBy queries
// - act() usage
// - Timeout handling
```
4. **Custom Render**
```typescript
// Test utilities:
// - Provider wrapper
// - Router wrapper
// - Custom options
```
5. **Mocking**
```typescript
// Mock strategies:
// - MSW for APIs
// - Module mocks
// - Context mocking
// - Timer mocking
```
6. **Accessibility Testing**
```typescript
// A11y assertions:
// - jest-axe
// - Role verification
// - Label associations
```
7. **Test Organization**
```typescript
// Structure:
// - describe blocks
// - Test naming
// - Setup/teardown
// - Shared fixtures
```
8. **Complete Test Suite**
```typescript
// Full tests for your component
```Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[{COMPONENT_CODE][{PURPOSE][{INTERACTIONS][{EDGE_CASES]