Skip to content

Commit 9e1bd04

Browse files
author
Said Shah
committed
Added tests for text input icon
1 parent 3f14189 commit 9e1bd04

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed
Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
import React from "react";
2+
import { TextInputIcon } from "./text-input-icon";
3+
import faker from "faker";
4+
import { render, fireEvent } from "@testing-library/react";
5+
import uuid from "uuid";
6+
import { Icons } from "../constants/icons";
27

38
describe("TextInputIcon", () => {
4-
test.skip("TODO - https://github.com/AndcultureCode/AndcultureCode.JavaScript.React.Components/issues/9", () => {});
9+
test("when default props, renders icon with input", () => {
10+
// Arrange
11+
const dataTestId = "dataTestId";
12+
const icon = Icons.Checkmark;
13+
14+
// Act
15+
const { getByTestId } = render(
16+
<TextInputIcon
17+
icon={icon}
18+
id={uuid()}
19+
onChange={() => {}}
20+
testId={dataTestId}
21+
/>
22+
);
23+
24+
// Assert
25+
expect(getByTestId(dataTestId)).not.toBeNil();
26+
});
527
});

0 commit comments

Comments
 (0)