fix: API key input uses password type and no autocomplete (#24864)

Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Atif
2025-09-02 07:07:24 +05:30
committed by GitHub
parent 2c462154f7
commit 84d09b8b8a
3 changed files with 50 additions and 11 deletions

View File

@@ -0,0 +1,16 @@
import { render } from '@testing-library/react'
import Input from './Input'
test('Input renders correctly as password type with no autocomplete', () => {
const { asFragment, getByPlaceholderText } = render(
<Input
type="password"
placeholder="API Key"
onChange={jest.fn()}
/>,
)
const input = getByPlaceholderText('API Key')
expect(input).toHaveAttribute('type', 'password')
expect(input).not.toHaveAttribute('autocomplete')
expect(asFragment()).toMatchSnapshot()
})