import { TEST_AUTH_OBJECT_FISKER } from "../../../utils/testing";

jest.mock("../../Contexts/SMSContext");
jest.mock("../../Contexts/UserContext");


import { render, waitFor } from "@testing-library/react";
import { BrowserRouter } from "react-router-dom";
import addSnapshotSerializer from "../../../utils/snapshot";
import { StatusProvider } from "../../Contexts/StatusContext";
import { setToken, UserProvider } from "../../Contexts/UserContext";
import SMSSend from "./index";


const renderSendSMS = async () => {
  const {container} = render(
    <StatusProvider>
      <BrowserRouter>
        <UserProvider>
          <SMSSend/>
        </UserProvider>
      </BrowserRouter>
    </StatusProvider>
  );
  await waitFor(() => {
    /* render */
  });

  return container;
}


describe("SMS Send Component", () => {
  beforeAll(() => {
    setToken(TEST_AUTH_OBJECT_FISKER);
    addSnapshotSerializer(expect);
  });

  it("Render", async () => {
    // setToken(TEST_AUTH_OBJECT_FISKER);
    const container = await renderSendSMS();
    expect(container).toMatchSnapshot();
  });
});