admin/components/events/create/ConsumerPickerTrigger.test.tsx
alisaza e1eaf5eff5 feat: initial ghabilee-admin backoffice app
Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js
app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
2026-09-05 13:12:59 +03:30

26 lines
826 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { fireEvent, render, screen } from '@testing-library/react'
import { describe, expect, it, vi } from 'vitest'
import ConsumerPickerTrigger from '@/components/events/create/ConsumerPickerTrigger'
describe('ConsumerPickerTrigger', () => {
it('renders the shared consumer picker style and opens on click', () => {
const onClick = vi.fn()
render(
<ConsumerPickerTrigger
aria-label="انتخاب تاریخ شروع"
onClick={onClick}
>
تاریخ شروع
</ConsumerPickerTrigger>
)
const trigger = screen.getByRole('button', { name: 'انتخاب تاریخ شروع' })
expect(trigger).toHaveClass('h-12', 'rounded-xl', 'bg-[#E2E2E280]', 'px-2', 'text-xs', 'font-medium')
fireEvent.click(trigger)
expect(onClick).toHaveBeenCalledOnce()
})
})