/** * Testing Utilities * Helper functions for consistent testing attribute generation * * For advanced selector patterns, use sel() from '@nextsparkjs/core/lib/selectors' * This file contains runtime utilities for accessibility and keyboard handling. */ /** * Create a Cypress selector ID by joining parts with hyphens * * @example * createCyId('verify-email', 'loading') // 'verify-email-loading' * createCyId('settings', 'billing', 'plans') // 'settings-billing-plans' */ declare function createCyId(...parts: string[]): string; /** * Create a test ID by joining parts with hyphens * * @example * createTestId('settings', 'billing') // 'settings-billing' */ declare function createTestId(...parts: string[]): string; /** * Simple selector function that joins parts with a dot * For advanced patterns use sel() from '@nextsparkjs/core/lib/selectors' * * @example * sel('auth', 'login', 'form') // 'auth.login.form' */ declare function sel(...parts: string[]): string; /** * Create state-based data attributes for conditional testing * * @param state - Current state value * @returns State attribute value */ declare function createStateAttr(state: 'active' | 'completed' | 'pending' | 'loading' | 'error'): string; /** * Create priority-based data attributes * * @param priority - Priority level * @returns Priority attribute value */ declare function createPriorityAttr(priority: 'low' | 'medium' | 'high'): string; /** * Generate testing props object for components * * @param config - Testing configuration * @returns Testing props object */ declare function createTestingProps(config: { testId?: string; cyId?: string; state?: 'active' | 'completed' | 'pending' | 'loading' | 'error'; priority?: 'low' | 'medium' | 'high'; taskId?: string; userId?: string; }): { [k: string]: string | undefined; }; /** * Accessibility helper for dynamic aria-label generation * * @param template - Label template with placeholders * @param values - Values to replace placeholders * @returns Formatted aria-label */ declare function createAriaLabel(template: string, values: Record): string; /** * Keyboard navigation helpers */ declare const keyboardHelpers: { /** * Handle Enter and Space key activation */ createActivationHandler: (onActivate: () => void) => (e: React.KeyboardEvent) => void; /** * Handle Escape key for closing */ createEscapeHandler: (onClose: () => void) => (e: React.KeyboardEvent) => void; /** * Handle arrow navigation in lists */ createArrowNavigationHandler: (currentIndex: number, maxIndex: number, onIndexChange: (index: number) => void) => (e: React.KeyboardEvent) => void; }; export { createAriaLabel, createCyId, createPriorityAttr, createStateAttr, createTestId, createTestingProps, keyboardHelpers, sel };