Files
kjol/tools/tsgo/internal/fourslash/tests/gen/jsxGenericQuickInfo_test.go
2026-07-09 16:50:43 -04:00

51 lines
1.7 KiB
Go

// Code generated by convertFourslash; DO NOT EDIT.
// To modify this test, run "npm run makemanual jsxGenericQuickInfo"
package fourslash_test
import (
"testing"
"github.com/microsoft/typescript-go/internal/fourslash"
"github.com/microsoft/typescript-go/internal/testutil"
)
func TestJsxGenericQuickInfo(t *testing.T) {
fourslash.SkipIfFailing(t)
t.Parallel()
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `//@Filename: file.tsx
declare namespace JSX {
interface Element { }
interface IntrinsicElements {
}
interface ElementAttributesProperty { props }
}
interface PropsA<T> {
/** comments for A */
name: 'A',
items: T[];
renderItem: (item: T) => string;
}
interface PropsB<T> {
/** comments for B */
name: 'B',
items: T[];
renderItem: (item: T) => string;
}
class Component<T> {
constructor(props: PropsA<T> | PropsB<T>) {}
props: PropsA<T> | PropsB<T>;
}
var b = new Component({items: [0, 1, 2], render/*0*/Item: it/*1*/em => item.toFixed(), name/*2*/: 'A',});
var c = <Component items={[0, 1, 2]} render/*3*/Item={it/*4*/em => item.toFixed()} name/*5*/="A" />`
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
defer done()
f.VerifyQuickInfoAt(t, "0", "(property) PropsA<number>.renderItem: (item: number) => string", "")
f.VerifyQuickInfoAt(t, "1", "(parameter) item: number", "")
f.VerifyQuickInfoAt(t, "2", "(property) PropsA<T>.name: \"A\"", "comments for A")
f.VerifyQuickInfoAt(t, "3", "(property) PropsA<number>.renderItem: (item: number) => string", "")
f.VerifyQuickInfoAt(t, "4", "(parameter) item: number", "")
f.VerifyQuickInfoAt(t, "5", "(property) PropsA<T>.name: \"A\"", "comments for A")
}