Skip to content

Commit f95b4b2

Browse files
authored
🤖 Merge PR DefinitelyTyped#68065 [react-big-calendar] Stop testing react-dom by @eps1lon
1 parent 8a08f45 commit f95b4b2

File tree

2 files changed

+26
-34
lines changed

2 files changed

+26
-34
lines changed

‎types/react-big-calendar/package.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
"@types/react": "*"
1212
},
1313
"devDependencies": {
14-
"@types/react-big-calendar": "workspace:.",
15-
"@types/react-dom": "*"
14+
"@types/react-big-calendar": "workspace:."
1615
},
1716
"owners": [
1817
{

‎types/react-big-calendar/react-big-calendar-tests.tsx‎

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import {
2828
Week,
2929
} from "react-big-calendar";
3030
import withDragAndDrop from "react-big-calendar/lib/addons/dragAndDrop";
31-
import * as ReactDOM from "react-dom";
3231

3332
// Don't want to add this as a dependency, because it is only used for tests.
3433
declare const globalize: any;
@@ -89,7 +88,7 @@ class CalendarResource {
8988

9089
const localizer = momentLocalizer(moment);
9190

92-
ReactDOM.render(<Basic localizer={localizer} />, document.body);
91+
<Basic localizer={localizer} />;
9392
}
9493

9594
// date-fns Example Test
@@ -110,7 +109,7 @@ class CalendarResource {
110109

111110
const localizer = dateFnsLocalizer(dateFnsConfig);
112111

113-
ReactDOM.render(<Basic localizer={localizer} />, document.body);
112+
<Basic localizer={localizer} />;
114113
}
115114

116115
// handle-drag-start Example Test
@@ -132,7 +131,7 @@ class CalendarResource {
132131

133132
const localizer = dateFnsLocalizer(dateFnsConfig);
134133

135-
ReactDOM.render(<HandleDragStart localizer={localizer} />, document.body);
134+
<HandleDragStart localizer={localizer} />;
136135
}
137136

138137
// luxon Example Test
@@ -153,7 +152,7 @@ class CalendarResource {
153152

154153
const localizer = luxonLocalizer(luxonConfig, { firstDayOfWeek: 0 });
155154

156-
ReactDOM.render(<Basic localizer={localizer} />, document.body);
155+
<Basic localizer={localizer} />;
157156
}
158157

159158
// dayjs Example Test
@@ -174,7 +173,7 @@ class CalendarResource {
174173

175174
const localizer = dayjsLocalizer(dayjs);
176175

177-
ReactDOM.render(<Basic localizer={localizer} />, document.body);
176+
<Basic localizer={localizer} />;
178177
}
179178

180179
// Drag and Drop Example Test
@@ -225,7 +224,7 @@ class CalendarResource {
225224

226225
const localizer = momentLocalizer(moment);
227226

228-
ReactDOM.render(<DnD localizer={localizer} />, document.body);
227+
<DnD localizer={localizer} />;
229228
}
230229

231230
// overriding 'views' props, with custom day view
@@ -244,16 +243,13 @@ class CalendarResource {
244243
}
245244
// supplying object to 'views' prop with only some of the supported views.
246245
// A view can be a boolean or implement title() and navigate()
247-
ReactDOM.render(
248-
<Calendar
249-
localizer={momentLocalizer(moment)}
250-
views={{
251-
day: DayComponent,
252-
work_week: true,
253-
}}
254-
/>,
255-
document.body,
256-
);
246+
<Calendar
247+
localizer={momentLocalizer(moment)}
248+
views={{
249+
day: DayComponent,
250+
work_week: true,
251+
}}
252+
/>;
257253
}
258254

259255
// overriding 'views' props, with custom day view using ViewProps interface
@@ -269,21 +265,18 @@ class CalendarResource {
269265
}
270266
// supplying object to 'views' prop with only some of the supported views.
271267
// A view can be a boolean or implement title() and navigate()
272-
ReactDOM.render(
273-
<Calendar
274-
localizer={momentLocalizer(moment)}
275-
views={{
276-
day: DayComponent,
277-
work_week: true,
278-
}}
279-
/>,
280-
document.body,
281-
);
268+
<Calendar
269+
localizer={momentLocalizer(moment)}
270+
views={{
271+
day: DayComponent,
272+
work_week: true,
273+
}}
274+
/>;
282275
}
283276

284277
// optional 'localizer' prop
285278
{
286-
ReactDOM.render(<Calendar localizer={momentLocalizer(moment)} />, document.body);
279+
<Calendar localizer={momentLocalizer(moment)} />;
287280
}
288281

289282
{
@@ -390,7 +383,7 @@ class CalendarResource {
390383
}
391384

392385
const localizer = globalizeLocalizer(globalize);
393-
ReactDOM.render(<FullAPIExample localizer={localizer} />, document.body);
386+
<FullAPIExample localizer={localizer} />;
394387
}
395388

396389
// Test fixtures
@@ -580,7 +573,7 @@ class Toolbar extends React.Component<ToolbarProps<CalendarEvent, CalendarResour
580573
<Calendar events={[]} localizer={localizer} components={{ month: { header, dateHeader, event } }} />
581574
);
582575

583-
ReactDOM.render(<Basic localizer={localizer} />, document.body);
576+
<Basic localizer={localizer} />;
584577
}
585578

586579
// test OnRangeChange return types
@@ -604,7 +597,7 @@ class Toolbar extends React.Component<ToolbarProps<CalendarEvent, CalendarResour
604597

605598
const localizer = momentLocalizer(moment);
606599

607-
ReactDOM.render(<Basic localizer={localizer} />, document.body);
600+
<Basic localizer={localizer} />;
608601
}
609602

610603
// Test Week and TimeGrid types
@@ -668,7 +661,7 @@ class MyDay extends Day {
668661

669662
// Using backgroundEvents
670663
{
671-
ReactDOM.render(<Calendar backgroundEvents={getEvents()} localizer={momentLocalizer(moment)} />, document.body);
664+
<Calendar backgroundEvents={getEvents()} localizer={momentLocalizer(moment)} />;
672665
}
673666

674667
// defaultView initializer

0 commit comments

Comments
 (0)