0

Не могу написать тест для этой строки, пишет что не покрыто, как мне написать тест для этой строки?

 onChange={({ target: { value } }) => setTestData(value)}

файл

import React, { useState } from "react";
    
    import OutlinedInput from "@mui/material/OutlinedInput";
    
    const Test = () => {
      const [testdata, setTestData] = useState<any>("");
    
      const [, setTestData2] = useState<boolean>(false);
    
      return (
        <OutlinedInput
          placeholder="Test"
          value={testdata}
          onChange={({ target: { value } }) => setTestData(value)}
        />
      );
    };
    
    export default Test;

jest

import React from "react";

import { render } from "@testing-library/react";

import Test from ".";

describe("Test", () => {
  test("test1", () => {
    const { container } = render(<Test />);

    expect(container).toBeInTheDocument();
  });
});

0

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Посмотрите другие вопросы с метками или задайте свой вопрос.