MCPcopy Create free account
hub / github.com/dailydotdev/apps / setup

Function setup

packages/shared/src/components/video/TutorialVideoButton.spec.tsx:18–40  ·  view source on GitHub ↗
({ videoId = 'igZCEr3HwCg', isGdprCovered = false } = {})

Source from the content-addressed store, hash-verified

16const videoUrl = 'https://r.daily.dev/feed-tags';
17
18function setup({ videoId = 'igZCEr3HwCg', isGdprCovered = false } = {}) {
19 const onParentClose = jest.fn();
20 const onParentClick = jest.fn();
21 const app = document.createElement('div');
22 document.body.appendChild(app);
23 ReactModal.setAppElement(app);
24 render(
25 <TestBootProvider client={new QueryClient()} auth={{ isGdprCovered }}>
26 <Modal isOpen contentLabel="Feed settings" onRequestClose={onParentClose}>
27 <input aria-label="Search tags" defaultValue="react" />
28 <div onClick={onParentClick} role="presentation">
29 <TutorialVideoButton
30 videoId={videoId}
31 videoUrl={videoUrl}
32 title={title}
33 />
34 </div>
35 </Modal>
36 </TestBootProvider>,
37 { container: app },
38 );
39 return { onParentClose, onParentClick };
40}
41
42it.each(['close button', 'Escape', 'backdrop'])(
43 'closes only the tutorial with %s and keeps the parent state and focus',

Callers 1

Calls 1

renderFunction · 0.50

Tested by

no test coverage detected