diff options
| author | Bertrand Yuan <189593334+bertyuan@users.noreply.github.com> | 2026-04-07 11:25:10 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-07 11:25:10 +0800 |
| commit | ede83fe814b50a33e619737363e6d0cfbba73d16 (patch) | |
| tree | cb562a3146445b3fa80e8f2c66674061a816701d /src/components/ui/input.test.tsx | |
| parent | 2ef9e56c390508f52d8734ba36fa4a23bec3558e (diff) | |
| parent | a3c86dbdff661303a5b3e1957f485eca2eae2414 (diff) | |
Merge pull request #17 from bertyuan/revert-15-tast
Revert "A small portion of newly added unit testing code"
Diffstat (limited to 'src/components/ui/input.test.tsx')
| -rw-r--r-- | src/components/ui/input.test.tsx | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/components/ui/input.test.tsx b/src/components/ui/input.test.tsx index 036352b..aabe76f 100644 --- a/src/components/ui/input.test.tsx +++ b/src/components/ui/input.test.tsx @@ -1,8 +1,6 @@ import { render, screen } from '@testing-library/react'; import { describe, expect, test } from 'vitest'; import { Input } from './input'; -import userEvent from '@testing-library/user-event'; -import { vi } from 'vitest'; describe('Input', () => { test('renders an input with the expected slot attribute', () => { @@ -20,19 +18,5 @@ describe('Input', () => { expect(input).toHaveAttribute('type', 'password'); expect(input).toBeDisabled(); }); - - test('handles user typing and triggers onChange event', async () => { - const user = userEvent.setup(); - const handleChange = vi.fn(); - - render(<Input aria-label="Username" onChange={handleChange} />); - const input = screen.getByLabelText('Username'); - - await user.type(input, 'hello world'); - - expect(input).toHaveValue('hello world'); - expect(handleChange).toHaveBeenCalled(); - expect(handleChange).toHaveBeenCalledTimes(11); - }); }); |
