Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 7f6e7c4

Browse files
committed
fix tests
1 parent 23c8915 commit 7f6e7c4

11 files changed

+37
-32
lines changed

tests/ppx/react/expected/commentAtTop.res_v4_auto.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
type props<'msg> = {key?: string, msg: 'msg} // test React JSX file
22

3-
let make = ({msg}: props<'msg>) => {
4-
ReactDOMRe.createDOMElementVariadic("div", [{msg->React.string}])
3+
let make = ({msg, _}: props<'msg>) => {
4+
Js.React.jsxDom("div", {children: {msg->React.string}})
55
}
66
let make = {
77
let \"CommentAtTop" = (props: props<_>) => make(props)

tests/ppx/react/expected/commentAtTop.res_v4_cls.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
type props<'msg> = {key?: string, msg: 'msg} // test React JSX file
22

3-
let make = ({msg}: props<'msg>) => {
3+
let make = ({msg, _}: props<'msg>) => {
44
ReactDOMRe.createDOMElementVariadic("div", [{msg->React.string}])
55
}
66
let make = {

tests/ppx/react/expected/externalWithCustomName.res_v4_auto.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ module Foo = {
44
external component: React.componentLike<props<'a, 'b>, React.element> = "component"
55
}
66

7-
let t = React.jsx(Foo.component, {a: 1, b: "1"})
7+
let t = Js.React.jsx(Foo.component, {a: 1, b: "1"})

tests/ppx/react/expected/forwardRef.res_v4_auto.txt

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ module FancyInput = {
55
children: 'children,
66
ref?: ReactDOM.Ref.currentDomRef,
77
}
8-
let make = ({className, children, ref}: props<'className, 'children>) => {
8+
let make = ({?className, children, ref, _}: props<'className, 'children>) => {
99
let ref = Js.Nullable.fromOption(ref)
1010
let _ = ref
1111

12-
ReactDOMRe.createDOMElementVariadic(
12+
Js.React.jsxsDom(
1313
"div",
14-
[
15-
ReactDOMRe.createDOMElementVariadic(
16-
"input",
17-
~props=ReactDOMRe.domProps(
18-
~type_="text",
19-
~className?,
20-
~ref=?{Js.Nullable.toOption(ref)->Belt.Option.map(ReactDOM.Ref.domRef)},
21-
(),
14+
{
15+
children: [
16+
Js.React.jsxDom(
17+
"input",
18+
{
19+
type_: "text",
20+
?className,
21+
ref: ?Js.Nullable.toOption(ref)->Belt.Option.map(ReactDOM.Ref.domRef),
22+
},
2223
),
23-
[],
24-
),
25-
children,
26-
],
24+
children,
25+
],
26+
},
2727
)
2828
}
2929
let make = React.forwardRef({
@@ -37,9 +37,14 @@ type props = {key?: string}
3737
let make = (_: props) => {
3838
let input = React.useRef(Js.Nullable.null)
3939

40-
ReactDOMRe.createDOMElementVariadic(
40+
Js.React.jsxDom(
4141
"div",
42-
[React.jsx(FancyInput.make, {ref: input, children: {React.string("Click to focus")}})],
42+
{
43+
children: Js.React.jsx(
44+
FancyInput.make,
45+
{ref: input, children: {React.string("Click to focus")}},
46+
),
47+
},
4348
)
4449
}
4550
let make = {

tests/ppx/react/expected/forwardRef.res_v4_cls.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module FancyInput = {
55
children: 'children,
66
ref?: ReactDOM.Ref.currentDomRef,
77
}
8-
let make = ({className, children, ref}: props<'className, 'children>) => {
8+
let make = ({?className, children, ref, _}: props<'className, 'children>) => {
99
let ref = Js.Nullable.fromOption(ref)
1010
let _ = ref
1111

tests/ppx/react/expected/innerModule.res_v4_auto.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
module Bar = {
22
type props<'a, 'b> = {key?: string, a: 'a, b: 'b}
3-
let make = ({a, b}: props<'a, 'b>) => {
3+
let make = ({a, b, _}: props<'a, 'b>) => {
44
Js.log("This function should be named `InnerModule.react$Bar`")
5-
ReactDOMRe.createDOMElementVariadic("div", [])
5+
Js.React.jsxDom("div", {key: ?None})
66
}
77
let make = {
88
let \"InnerModule$Bar" = (props: props<_>) => make(props)
99
\"InnerModule$Bar"
1010
}
1111
type props<'a, 'b> = {key?: string, a: 'a, b: 'b}
1212

13-
let component = ({a, b}: props<'a, 'b>) => {
13+
let component = ({a, b, _}: props<'a, 'b>) => {
1414
Js.log("This function should be named `InnerModule.react$Bar$component`")
15-
ReactDOMRe.createDOMElementVariadic("div", [])
15+
Js.React.jsxDom("div", {key: ?None})
1616
}
1717
let component = {
1818
let \"InnerModule$Bar$component" = (props: props<_>) => make(props)

tests/ppx/react/expected/innerModule.res_v4_cls.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Bar = {
22
type props<'a, 'b> = {key?: string, a: 'a, b: 'b}
3-
let make = ({a, b}: props<'a, 'b>) => {
3+
let make = ({a, b, _}: props<'a, 'b>) => {
44
Js.log("This function should be named `InnerModule.react$Bar`")
55
ReactDOMRe.createDOMElementVariadic("div", [])
66
}
@@ -10,7 +10,7 @@ module Bar = {
1010
}
1111
type props<'a, 'b> = {key?: string, a: 'a, b: 'b}
1212

13-
let component = ({a, b}: props<'a, 'b>) => {
13+
let component = ({a, b, _}: props<'a, 'b>) => {
1414
Js.log("This function should be named `InnerModule.react$Bar$component`")
1515
ReactDOMRe.createDOMElementVariadic("div", [])
1616
}

tests/ppx/react/expected/newtype.res_v4_auto.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
type props<'a, 'b, 'c> = {key?: string, a: 'a, b: 'b, c: 'c}
22
let make = (_: props<'a, 'b, 'c>, type a, ~a: a, ~b: array<option<[#Foo(a)]>>, ~c: 'a, _) =>
3-
ReactDOMRe.createDOMElementVariadic("div", [])
3+
Js.React.jsxDom("div", {key: ?None})
44
let make = {
55
let \"Newtype" = (props: props<_>) => make(props)
66
\"Newtype"

tests/ppx/react/expected/topLevel.res_v4_auto.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
type props<'a, 'b> = {key?: string, a: 'a, b: 'b}
2-
let make = ({a, b}: props<'a, 'b>) => {
2+
let make = ({a, b, _}: props<'a, 'b>) => {
33
Js.log("This function should be named 'TopLevel.react'")
4-
ReactDOMRe.createDOMElementVariadic("div", [])
4+
Js.React.jsxDom("div", {key: ?None})
55
}
66
let make = {
77
let \"TopLevel" = (props: props<_>) => make(props)

tests/ppx/react/expected/topLevel.res_v4_cls.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
type props<'a, 'b> = {key?: string, a: 'a, b: 'b}
2-
let make = ({a, b}: props<'a, 'b>) => {
2+
let make = ({a, b, _}: props<'a, 'b>) => {
33
Js.log("This function should be named 'TopLevel.react'")
44
ReactDOMRe.createDOMElementVariadic("div", [])
55
}

tests/ppx/react/expected/typeConstraint.res_v4_auto.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
type props<'a, 'b> = {key?: string, a: 'a, b: 'b}
22
let make: 'a. (~a: 'a, ~b: 'a, 'a) => React.element = (_: props<'a, 'b>, type a): (
33
(~a: a, ~b: a, a) => React.element
4-
) => (~a, ~b, _) => ReactDOMRe.createDOMElementVariadic("div", [])
4+
) => (~a, ~b, _) => Js.React.jsxDom("div", {key: ?None})
55
let make = {
66
let \"TypeConstraint" = (props: props<_>) => make(props)
77
\"TypeConstraint"

0 commit comments

Comments
 (0)