2022-02-02 22:48:33 +00:00
|
|
|
import React from "react";
|
|
|
|
import { mount } from "enzyme";
|
|
|
|
import CodeInput from ".";
|
|
|
|
|
|
|
|
describe("<CodeInput />", () => {
|
|
|
|
it("renders without error", () => {
|
2022-05-27 19:01:14 +00:00
|
|
|
const wrapper = mount(<CodeInput onSubmit={jest.fn()} />);
|
2022-02-02 22:48:33 +00:00
|
|
|
|
|
|
|
expect(wrapper).toExist();
|
|
|
|
});
|
2022-03-03 09:54:35 +00:00
|
|
|
|
|
|
|
it("accepts id", () => {
|
2022-05-27 19:01:14 +00:00
|
|
|
const wrapper = mount(<CodeInput onSubmit={jest.fn()} id="testId" />);
|
2022-03-03 09:54:35 +00:00
|
|
|
|
|
|
|
expect(wrapper.prop("id")).toEqual("testId");
|
|
|
|
});
|
|
|
|
|
|
|
|
it("accepts className", () => {
|
2022-05-27 19:01:14 +00:00
|
|
|
const wrapper = mount(<CodeInput onSubmit={jest.fn()} className="test" />);
|
2022-03-03 09:54:35 +00:00
|
|
|
|
|
|
|
expect(wrapper.prop("className")).toEqual("test");
|
|
|
|
});
|
|
|
|
|
|
|
|
it("accepts style", () => {
|
2022-05-27 19:01:14 +00:00
|
|
|
const wrapper = mount(
|
|
|
|
<CodeInput onSubmit={jest.fn()} style={{ color: "red" }} />
|
|
|
|
);
|
2022-03-03 09:54:35 +00:00
|
|
|
|
|
|
|
expect(wrapper.getDOMNode().style).toHaveProperty("color", "red");
|
|
|
|
});
|
2022-02-02 22:48:33 +00:00
|
|
|
});
|