You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Input.test.tsx 506B

12345678910111213141516
  1. import { render } from '@testing-library/react'
  2. import Input from './Input'
  3. test('Input renders correctly as password type with no autocomplete', () => {
  4. const { asFragment, getByPlaceholderText } = render(
  5. <Input
  6. type="password"
  7. placeholder="API Key"
  8. onChange={jest.fn()}
  9. />,
  10. )
  11. const input = getByPlaceholderText('API Key')
  12. expect(input).toHaveAttribute('type', 'password')
  13. expect(input).not.toHaveAttribute('autocomplete')
  14. expect(asFragment()).toMatchSnapshot()
  15. })