This repository has been archived by the owner on Feb 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add dependencies and more tests
- Loading branch information
1 parent
77fcdc1
commit 18f7d72
Showing
28 changed files
with
352 additions
and
101 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/components/Base/Input/PasswordInput.component.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {fireEvent, render, screen} from '@testing-library/react'; | ||
import {describe, expect, it} from 'vitest'; | ||
|
||
import {PasswordInput} from './PasswordInput.component'; | ||
|
||
describe('PasswordInput', () => { | ||
it('toggles password visibility when the toggle button is clicked', () => { | ||
render(<PasswordInput />); | ||
const toggleButton = screen.getByLabelText('toggle password visibility'); | ||
const passwordInput = screen.getByPlaceholderText('Enter password'); | ||
|
||
fireEvent.click(toggleButton); | ||
expect(passwordInput).toHaveAttribute('type', 'text'); | ||
|
||
fireEvent.click(toggleButton); | ||
expect(passwordInput).toHaveAttribute('type', 'password'); | ||
}); | ||
}); |
Oops, something went wrong.