import React from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' import type { UnifiedSearchResult } from '@d3ro/core/types' import { NativeThemeProvider, getD3roNativePalette } from '@d3ro/ui-native' import { UnifiedSearchResultRow } from '../src/components/UnifiedSearchResultRow' const result: UnifiedSearchResult = { source: 'meeting', id: '33333333-3333-4333-8333-333333333333', title: '주간 회의', excerpt: '로드맵을 다음 주에 검토합니다.', matchedField: 'transcript', occurredAt: Date.parse('2026-09-28T00:00:00.000Z'), } describe('UnifiedSearchResultRow', () => { test('exposes a named button and forwards the source result', () => { const onPress = jest.fn() let renderer: ReactTestRenderer | undefined act(() => { renderer = create( , ) }) const button = renderer!.root.findByProps({ testID: `unified-search-open-${result.source}-${result.id}`, }) expect(button.props.accessibilityRole).toBe('button') expect(button.props.accessibilityLabel).toBe('회의 ‘주간 회의’ 열기') act(() => button.props.onPress()) expect(onPress).toHaveBeenCalledWith(result) act(() => renderer!.unmount()) }) })