import React, { useContext } from "react";
import { Text } from "react-native";
import { render } from "@testing-library/react-native";
import { FocusableGroupContextProvider, FocusableGroupContext } from "../";

const MockComponent = () => {
  const focusableContext = useContext(FocusableGroupContext) || "default";

  return <Text testID={focusableContext} />;
};

describe("FocusableGroupContextProvider", () => {
  it("should provide focusable context to the wrapped component", () => {
    const { getByTestId } = render(
      <FocusableGroupContextProvider id="testId">
        <MockComponent />
      </FocusableGroupContextProvider>
    );

    expect(getByTestId("testId")).toBeTruthy();
  });
});
