import { render, screen } from '@testing-library/react'
import { describe, expect, it, vi } from 'vitest'
import { ProfileSection } from '../ProfileSection'

vi.mock('@/shared/model/auth', () => ({
  $user: null,
  $updateProfileError: null,
  updateProfileFx: { pending: false },
}))

vi.mock('effector-react', async () => {
  const actual = await vi.importActual('effector-react')
  return { ...actual, useUnit: () => null }
})

describe('ProfileSection', () => {
  it('renders profile section', () => {
    render(<ProfileSection />)
    expect(screen.getByText('Профиль')).toBeTruthy()
    expect(screen.getByLabelText('Имя или ник')).toBeTruthy()
    expect(screen.getByRole('button', { name: 'Сохранить' })).toBeTruthy()
  })
})
