File size: 551 Bytes
cf86710
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { type RenderResult, render, screen } from "@testing-library/react";
import React, { type ReactElement } from "react";

/**
 * Renders the examples into an application for easier testing.
 *
 * @deprecated This is ugly and should be removed.
 */
export function renderApp(example: ReactElement): {
  dayPicker: HTMLElement | ChildNode | null;
  renderResult: RenderResult;
} {
  const renderResult = render(<div role="application">{example}</div>);
  return {
    dayPicker: screen.getByRole("application").firstChild,
    renderResult,
  };
}