admin/components/forms/UnsavedChangesIndicator.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

21 lines
694 B
TypeScript

import { cleanup, render, screen } from '@testing-library/react'
import { afterEach, describe, expect, it } from 'vitest'
import UnsavedChangesIndicator from '@/components/forms/UnsavedChangesIndicator'
afterEach(cleanup)
describe('UnsavedChangesIndicator', () => {
it('announces unsaved changes', () => {
render(<UnsavedChangesIndicator isDirty />)
expect(screen.getByRole('status')).toHaveTextContent('تغییرات ذخیره‌نشده دارید')
})
it('announces the clean state', () => {
render(<UnsavedChangesIndicator isDirty={false} />)
expect(screen.getByRole('status')).toHaveTextContent('تغییری برای ذخیره وجود ندارد')
})
})