import * as React from 'react'

import {describe, expect, it} from 'vitest'

import {render} from '../../test-utils'

import {Input} from './input'

describe('Input', () => {
  it('accepts and forwards innerRef prop to input element', () => {
    const ref = React.createRef<HTMLInputElement>()

    const {container} = render(
      <Input innerRef={ref} placeholder="Test input" />
    )

    const inputElement = container.querySelector('input')
    expect(inputElement).toBeTruthy()
    expect(ref.current).toBe(inputElement)
  })
})
