Skip to content

Commit 65ec0f6

Browse files
test: added new test case for counter
1 parent 9de76d4 commit 65ec0f6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/components/Input/__test__/Input.test.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { render, screen, act } from "@testing-library/react";
1+
import { render, screen } from "@testing-library/react";
22
import { userEvent } from '@testing-library/user-event';
33
import { Input } from "..";
4-
import { createRef } from 'react';
54

65

76
const props = { label: "Test", message: "Test message", id: "test" };
@@ -127,15 +126,15 @@ describe("Input", () => {
127126
expect(handleChange).toHaveBeenCalledTimes(5);
128127
});
129128

130-
it('limits input length based on maxLength prop', async() => {
129+
it('limits input length based on maxLength prop', async () => {
131130
render(<Input
132131
label="Username"
133132
shouldShowCounter
134133
maxLength={5}
135134
/>);
136135
const input = screen.getByLabelText("Username");
137136
await userEvent.type(input, 'Too much input');
138-
expect(input).toHaveProperty('value','Too m')
137+
expect(input).toHaveProperty('value', 'Too m')
139138
});
140139

141140
it("should not display character counter if shouldShowCounter is false", () => {

0 commit comments

Comments
 (0)