From 207e3a99ea9b44f67d63c93fbf6d2dc868435d70 Mon Sep 17 00:00:00 2001 From: Alexander T Date: Thu, 2 Apr 2020 11:36:54 +0300 Subject: [PATCH] fix(37456): add tests for JsxOpeningElement nodes --- .../tsxTypeArgumentsJsxPreserveOutput.js | 29 +++++++++- .../tsxTypeArgumentsJsxPreserveOutput.symbols | 45 +++++++++++++++ .../tsxTypeArgumentsJsxPreserveOutput.types | 56 ++++++++++++++++++- .../jsx/tsxTypeArgumentsJsxPreserveOutput.tsx | 15 ++++- 4 files changed, 142 insertions(+), 3 deletions(-) diff --git a/tests/baselines/reference/tsxTypeArgumentsJsxPreserveOutput.js b/tests/baselines/reference/tsxTypeArgumentsJsxPreserveOutput.js index aab5d71021596..39c8d54091e4d 100644 --- a/tests/baselines/reference/tsxTypeArgumentsJsxPreserveOutput.js +++ b/tests/baselines/reference/tsxTypeArgumentsJsxPreserveOutput.js @@ -9,6 +9,7 @@ function Foo() { } <> + {/* JsxSelfClosingElement */} /> /> /> @@ -19,7 +20,20 @@ function Foo() { /> /> /> - + + {/* JsxOpeningElement */} + > + > + > + > + > + > + > + > + > + > + + //// [foo.jsx] "use strict"; @@ -29,6 +43,7 @@ function Foo() { return null; } <> + @@ -39,4 +54,16 @@ function Foo() { + + + + + + + + + + + + ; diff --git a/tests/baselines/reference/tsxTypeArgumentsJsxPreserveOutput.symbols b/tests/baselines/reference/tsxTypeArgumentsJsxPreserveOutput.symbols index 41b6c9ca4dfd0..4a199f1a99696 100644 --- a/tests/baselines/reference/tsxTypeArgumentsJsxPreserveOutput.symbols +++ b/tests/baselines/reference/tsxTypeArgumentsJsxPreserveOutput.symbols @@ -18,6 +18,7 @@ function Foo() { } <> + {/* JsxSelfClosingElement */} /> >Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) @@ -50,4 +51,48 @@ function Foo() { >Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) >InterfaceProps : Symbol(InterfaceProps, Decl(foo.tsx, 2, 36)) + {/* JsxOpeningElement */} + > +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) + + > +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) + + > +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) + + > +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) + + > +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) + + > +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) + + > +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) + + > +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) + + > +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) +>TypeProps : Symbol(TypeProps, Decl(foo.tsx, 0, 32)) +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) + + > +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) +>InterfaceProps : Symbol(InterfaceProps, Decl(foo.tsx, 2, 36)) +>Foo : Symbol(Foo, Decl(foo.tsx, 3, 43)) + + diff --git a/tests/baselines/reference/tsxTypeArgumentsJsxPreserveOutput.types b/tests/baselines/reference/tsxTypeArgumentsJsxPreserveOutput.types index c41a8b7152b18..a03c907d3bbf2 100644 --- a/tests/baselines/reference/tsxTypeArgumentsJsxPreserveOutput.types +++ b/tests/baselines/reference/tsxTypeArgumentsJsxPreserveOutput.types @@ -17,8 +17,9 @@ function Foo() { } <> -><> /> /> /> /> /> /> /> /> /> /> : JSX.Element +><> {/* JsxSelfClosingElement */} /> /> /> /> /> /> /> /> /> /> {/* JsxOpeningElement */} > > > > > > > > > > : JSX.Element + {/* JsxSelfClosingElement */} /> > /> : JSX.Element >Foo : () => any @@ -58,6 +59,59 @@ function Foo() { /> > /> : JSX.Element +>Foo : () => any + + {/* JsxOpeningElement */} + > +>> : JSX.Element +>Foo : () => any +>Foo : () => any + + > +>> : JSX.Element +>Foo : () => any +>Foo : () => any + + > +>> : JSX.Element +>Foo : () => any +>Foo : () => any + + > +>> : JSX.Element +>Foo : () => any +>Foo : () => any + + > +>> : JSX.Element +>Foo : () => any +>null : null +>Foo : () => any + + > +>> : JSX.Element +>Foo : () => any +>Foo : () => any + + > +>> : JSX.Element +>Foo : () => any +>Foo : () => any + + > +>> : JSX.Element +>Foo : () => any +>Foo : () => any + + > +>> : JSX.Element +>Foo : () => any +>Foo : () => any + + > +>> : JSX.Element +>Foo : () => any >Foo : () => any + diff --git a/tests/cases/conformance/jsx/tsxTypeArgumentsJsxPreserveOutput.tsx b/tests/cases/conformance/jsx/tsxTypeArgumentsJsxPreserveOutput.tsx index 8969b3124e357..0ac1d12eb5a84 100644 --- a/tests/cases/conformance/jsx/tsxTypeArgumentsJsxPreserveOutput.tsx +++ b/tests/cases/conformance/jsx/tsxTypeArgumentsJsxPreserveOutput.tsx @@ -14,6 +14,7 @@ function Foo() { } <> + {/* JsxSelfClosingElement */} /> /> /> @@ -24,4 +25,16 @@ function Foo() { /> /> /> - \ No newline at end of file + + {/* JsxOpeningElement */} + > + > + > + > + > + > + > + > + > + > +