mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-15 18:53:06 +00:00
Emends B47 so focusing the input clears strip/summary before typing; hardens hit rows against blur-before-click.
31 lines
994 B
TypeScript
31 lines
994 B
TypeScript
import { render, screen } from '@testing-library/react'
|
|
import { describe, expect, it, vi } from 'vitest'
|
|
|
|
import { CampaignHomeSearch } from '@/components/campaign/dashboard/CampaignHomeSearch'
|
|
import { HomeSearchProvider } from '@/components/campaign/dashboard/HomeSearchContext'
|
|
|
|
const providerValue = {
|
|
query: { raw: 'ca', debounced: 'ca', isActive: true },
|
|
setRaw: vi.fn(),
|
|
clear: vi.fn(),
|
|
isDebouncing: false,
|
|
inputFocused: false,
|
|
setInputFocused: vi.fn(),
|
|
uiFocused: true,
|
|
}
|
|
|
|
describe('CampaignHomeSearch', () => {
|
|
it('renders search input and results region', () => {
|
|
render(
|
|
<HomeSearchProvider value={providerValue}>
|
|
<CampaignHomeSearch>
|
|
<p>Group stub</p>
|
|
</CampaignHomeSearch>
|
|
</HomeSearchProvider>,
|
|
)
|
|
|
|
expect(screen.getByLabelText('Buscar na campanha')).toBeTruthy()
|
|
expect(screen.getByRole('region', { name: 'Resultados da busca' })).toBeTruthy()
|
|
expect(screen.getByText('Group stub')).toBeTruthy()
|
|
})
|
|
})
|