UNPKG

@c15t/react

Version:

Developer-first CMP for React: cookie banner, consent manager, preferences centre. GDPR ready with minimal setup and rich customization

30 lines 994 B
import type { ReactNode } from 'react'; import type { ThemeValue } from '../types/theme'; interface ComponentStyles { component: ReactNode; testCases: { testId: string; styles: string | ThemeValue; }[]; noStyle?: boolean; } /** * A robust test utility to verify components render correctly with applied styles. * * This function: * - Handles both direct container elements and portal-rendered elements * - Performs basic className checks * - Is tolerant of browser-specific style differences * - Works with string classNames and object style formats * * @example * ```tsx * await testComponentStyles({ * component: <MyComponent theme={{ root: 'custom-class' }} />, * testCases: [{ testId: 'my-component-root', styles: 'custom-class' }] * }); * ``` */ export declare function testComponentStyles({ component, testCases, noStyle, }: ComponentStyles): Promise<void>; export default testComponentStyles; //# sourceMappingURL=test-helpers.d.ts.map