Skip to content

Commit

Permalink
Don't use JSX where a specific version needs to be used
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Apr 9, 2024
1 parent 0f62703 commit 8d3a6c9
Show file tree
Hide file tree
Showing 3 changed files with 463 additions and 333 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ describe('editing interface', () => {

act(() =>
ReactDOM.render(
<ClassComponent
array={[1, 2, 3]}
object={{nested: 'initial'}}
shallow="initial"
/>,
React.createElement(ClassComponent, {
array: [1, 2, 3],
object: {nested: 'initial'},
shallow: 'initial',
}),
document.createElement('div'),
),
);
Expand Down Expand Up @@ -270,7 +270,10 @@ describe('editing interface', () => {

act(() =>
ReactDOM.render(
<ClassComponent object={{nested: 'initial'}} shallow="initial" />,
React.createElement(ClassComponent, {
object: {nested: 'initial'},
shallow: 'initial',
}),
document.createElement('div'),
),
);
Expand Down Expand Up @@ -489,9 +492,11 @@ describe('editing interface', () => {

act(() =>
ReactDOM.render(
<LegacyContextProvider>
<ClassComponent />
</LegacyContextProvider>,
React.createElement(
LegacyContextProvider,
null,
React.createElement(ClassComponent),
),
document.createElement('div'),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ describe('InspectedElementContext', () => {
const Example = () => null;

act(() =>
ReactDOM.render(<Example a={1} b="abc" />, document.createElement('div')),
ReactDOM.render(
React.createElement(Example, {a: 1, b: 'abc'}),
document.createElement('div'),
),
);

const id = ((store.getElementIDAtIndex(0): any): number);
Expand Down Expand Up @@ -91,19 +94,19 @@ describe('InspectedElementContext', () => {

act(() =>
ReactDOM.render(
<Example
boolean_false={false}
boolean_true={true}
infinity={Infinity}
integer_zero={0}
integer_one={1}
float={1.23}
string="abc"
string_empty=""
nan={NaN}
value_null={null}
value_undefined={undefined}
/>,
React.createElement(Example, {
boolean_false: false,
boolean_true: true,
infinity: Infinity,
integer_zero: 0,
integer_one: 1,
float: 1.23,
string: 'abc',
string_empty: '',
nan: NaN,
value_null: null,
value_undefined: undefined,
}),
document.createElement('div'),
),
);
Expand Down Expand Up @@ -178,28 +181,28 @@ describe('InspectedElementContext', () => {

act(() =>
ReactDOM.render(
<Example
anonymous_fn={instance.anonymousFunction}
array_buffer={arrayBuffer}
array_of_arrays={arrayOfArrays}
React.createElement(Example, {
anonymous_fn: instance.anonymousFunction,
array_buffer: arrayBuffer,
array_of_arrays: arrayOfArrays,
// eslint-disable-next-line no-undef
big_int={BigInt(123)}
bound_fn={exampleFunction.bind(this)}
data_view={dataView}
date={new Date(123)}
fn={exampleFunction}
html_element={div}
immutable={immutableMap}
map={mapShallow}
map_of_maps={mapOfMaps}
object_of_objects={objectOfObjects}
react_element={<span />}
regexp={/abc/giu}
set={setShallow}
set_of_sets={setOfSets}
symbol={Symbol('symbol')}
typed_array={typedArray}
/>,
big_int: BigInt(123),
bound_fn: exampleFunction.bind(this),
data_view: dataView,
date: new Date(123),
fn: exampleFunction,
html_element: div,
immutable: immutableMap,
map: mapShallow,
map_of_maps: mapOfMaps,
object_of_objects: objectOfObjects,
react_element: React.createElement('span'),
regexp: /abc/giu,
set: setShallow,
set_of_sets: setOfSets,
symbol: Symbol('symbol'),
typed_array: typedArray,
}),
document.createElement('div'),
),
);
Expand Down Expand Up @@ -333,7 +336,7 @@ describe('InspectedElementContext', () => {

act(() =>
ReactDOM.render(
<Example object={object} />,
React.createElement(Example, {object}),
document.createElement('div'),
),
);
Expand Down Expand Up @@ -363,7 +366,7 @@ describe('InspectedElementContext', () => {

act(() =>
ReactDOM.render(
<Example object={object} />,
React.createElement(Example, {object}),
document.createElement('div'),
),
);
Expand All @@ -390,7 +393,7 @@ describe('InspectedElementContext', () => {

act(() =>
ReactDOM.render(
<Example iteratable={iteratable} />,
React.createElement(Example, {iteratable}),
document.createElement('div'),
),
);
Expand Down Expand Up @@ -445,7 +448,7 @@ describe('InspectedElementContext', () => {

act(() =>
ReactDOM.render(
<Example data={new CustomData()} />,
React.createElement(Example, {data: new CustomData()}),
document.createElement('div'),
),
);
Expand Down Expand Up @@ -537,7 +540,10 @@ describe('InspectedElementContext', () => {
});

act(() =>
ReactDOM.render(<Example data={object} />, document.createElement('div')),
ReactDOM.render(
React.createElement(Example, {data: object}),
document.createElement('div'),
),
);

const id = ((store.getElementIDAtIndex(0): any): number);
Expand Down Expand Up @@ -605,7 +611,7 @@ describe('InspectedElementContext', () => {
const Example = ({data}) => null;
act(() =>
ReactDOM.render(
<Example data={testData} />,
React.createElement(Example, {data: testData}),
document.createElement('div'),
),
);
Expand All @@ -631,8 +637,8 @@ describe('InspectedElementContext', () => {

act(() =>
ReactDOM.render(
<Example
nestedObject={{
React.createElement(Example, {
nestedObject: {
a: {
b: {
c: [
Expand All @@ -644,8 +650,8 @@ describe('InspectedElementContext', () => {
],
},
},
}}
/>,
},
}),
document.createElement('div'),
),
);
Expand Down Expand Up @@ -746,7 +752,7 @@ describe('InspectedElementContext', () => {

act(() =>
ReactDOM.render(
<Example nestedObject={nestedObject} />,
React.createElement(Example, {nestedObject}),
document.createElement('div'),
),
);
Expand Down Expand Up @@ -802,7 +808,7 @@ describe('InspectedElementContext', () => {

act(() =>
ReactDOM.render(
<Example nestedObject={nestedObject} />,
React.createElement(Example, {nestedObject}),
document.createElement('div'),
),
);
Expand Down Expand Up @@ -872,17 +878,17 @@ describe('InspectedElementContext', () => {

act(() =>
ReactDOM.render(
<Example
arrayBuffer={arrayBuffer}
dataView={dataView}
map={map}
set={set}
mapOfMaps={mapOfMaps}
setOfSets={setOfSets}
typedArray={typedArray}
immutable={immutable}
bigInt={bigInt}
/>,
React.createElement(Example, {
arrayBuffer: arrayBuffer,
dataView: dataView,
map: map,
set: set,
mapOfMaps: mapOfMaps,
setOfSets: setOfSets,
typedArray: typedArray,
immutable: immutable,
bigInt: bigInt,
}),
document.createElement('div'),
),
);
Expand Down
Loading

0 comments on commit 8d3a6c9

Please sign in to comment.