feat(7411): Add additional test cases (#53809)

This commit is contained in:
Oleksandr T
2023-04-17 19:44:34 +03:00
committed by GitHub
parent 430c5be783
commit 020ce0c08c
5 changed files with 35 additions and 4 deletions

View File

@@ -34,11 +34,13 @@ tests/cases/compiler/jsxElementType.tsx(91,2): error TS2786: 'ReactNativeFlatLis
tests/cases/compiler/jsxElementType.tsx(95,11): error TS2322: Type '{}' is not assignable to type 'LibraryManagedAttributes<T, {}>'.
tests/cases/compiler/jsxElementType.tsx(98,2): error TS2304: Cannot find name 'Unresolved'.
tests/cases/compiler/jsxElementType.tsx(99,2): error TS2304: Cannot find name 'Unresolved'.
tests/cases/compiler/jsxElementType.tsx(109,19): error TS2322: Type '{ a: string; b: string; }' is not assignable to type '{ a: string; }'.
tests/cases/compiler/jsxElementType.tsx(110,6): error TS2322: Type '{ b: string; }' is not assignable to type '{ a: string; }'.
Property 'b' does not exist on type '{ a: string; }'.
tests/cases/compiler/jsxElementType.tsx(111,19): error TS2322: Type '{ a: string; b: string; }' is not assignable to type '{ a: string; }'.
Property 'b' does not exist on type '{ a: string; }'.
==== tests/cases/compiler/jsxElementType.tsx (19 errors) ====
==== tests/cases/compiler/jsxElementType.tsx (20 errors) ====
/// <reference path="/.lib/react16.d.ts" />
import * as React from "react";
@@ -208,6 +210,11 @@ tests/cases/compiler/jsxElementType.tsx(109,19): error TS2322: Type '{ a: string
}
}
<a:b a="accepted" />;
<a:b b="rejected" />;
~
!!! error TS2322: Type '{ b: string; }' is not assignable to type '{ a: string; }'.
!!! error TS2322: Property 'b' does not exist on type '{ a: string; }'.
<a:b a="accepted" b="rejected" />;
~
!!! error TS2322: Type '{ a: string; b: string; }' is not assignable to type '{ a: string; }'.

View File

@@ -107,6 +107,8 @@ declare global {
}
}
<a:b a="accepted" />;
<a:b b="rejected" />;
<a:b a="accepted" b="rejected" />;
@@ -241,4 +243,6 @@ function f1(Component) {
}
React.createElement(Unresolved, null);
React.createElement(Unresolved, { foo: "abc" });
React.createElement("a:b", { a: "accepted" });
React.createElement("a:b", { b: "rejected" });
React.createElement("a:b", { a: "accepted", b: "rejected" });

View File

@@ -289,7 +289,13 @@ declare global {
}
}
<a:b a="accepted" b="rejected" />;
<a:b a="accepted" />;
>a : Symbol(a, Decl(jsxElementType.tsx, 108, 4))
>b : Symbol(b, Decl(jsxElementType.tsx, 108, 17))
<a:b b="rejected" />;
>b : Symbol(b, Decl(jsxElementType.tsx, 109, 4))
<a:b a="accepted" b="rejected" />;
>a : Symbol(a, Decl(jsxElementType.tsx, 110, 4))
>b : Symbol(b, Decl(jsxElementType.tsx, 110, 17))

View File

@@ -303,6 +303,18 @@ declare global {
}
}
<a:b a="accepted" />;
><a:b a="accepted" /> : JSX.Element
>a : any
>b : any
>a : string
<a:b b="rejected" />;
><a:b b="rejected" /> : JSX.Element
>a : any
>b : any
>b : string
<a:b a="accepted" b="rejected" />;
><a:b a="accepted" b="rejected" /> : JSX.Element
>a : any

View File

@@ -108,4 +108,6 @@ declare global {
}
}
<a:b a="accepted" />;
<a:b b="rejected" />;
<a:b a="accepted" b="rejected" />;