/**
 * @vitest-environment node
 */
import { renderToString } from "react-dom/server";
import { DEFAULT_BREAKPOINTS, useBreakpoint } from ".";

function TestComponent() {
  const { breakpoint } = useBreakpoint();
  return <div data-testid="breakpoint">{breakpoint.size}</div>;
}

describe("useBreakpoint SSR", () => {
  it("renders the default breakpoint on the server", () => {
    const view = renderToString(<TestComponent />);

    expect(view).toContain(DEFAULT_BREAKPOINTS[0].size);
  });
});
