import {render, screen} from "@testing-library/react";
import MockAppWithProviders from "../../../../../../../../../../../../mocks/AppWithProvider";
import PreviousOperatorData from "../../PreviousOperatorData";

describe("PreviousOperatorData Component From call history", () => {
    describe("Rendering", () => {
        const historyItem = {
            operator_name: "test name",
            answer_date: "test date"
        }
        it("operator name rendered", () => {
            render(<MockAppWithProviders><PreviousOperatorData historyItem={historyItem}/></MockAppWithProviders>);
            const operatorName = screen.queryByText("test name");
            expect(operatorName).toBeInTheDocument();
        });
        it("operator answer date rendered", () => {
            render(<MockAppWithProviders><PreviousOperatorData historyItem={historyItem}/></MockAppWithProviders>);
            const operatorAnswerDate = screen.queryByText("test date");
            expect(operatorAnswerDate).toBeInTheDocument();
        });
    });
});