41 lines
1.5 KiB
Go
41 lines
1.5 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual tsxSignatureHelp1"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestTsxSignatureHelp1(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @jsx: preserve
|
|
//@Filename: file.tsx
|
|
import React = require('react');
|
|
export interface ClickableProps {
|
|
children?: string;
|
|
className?: string;
|
|
}
|
|
export interface ButtonProps extends ClickableProps {
|
|
onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
|
|
}
|
|
function _buildMainButton({ onClick, children, className }: ButtonProps): JSX.Element {
|
|
return(<button className={className} onClick={onClick}>{ children || 'MAIN BUTTON'}</button>);
|
|
}
|
|
export function MainButton(props: ButtonProps): JSX.Element {
|
|
return this._buildMainButton(props);
|
|
}
|
|
let e1 = <MainButton/*1*/ /*2*/`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.GoToMarker(t, "1")
|
|
f.VerifySignatureHelp(t, fourslash.VerifySignatureHelpOptions{Text: "MainButton(props: ButtonProps): JSX.Element", ParameterSpan: "props: ButtonProps"})
|
|
f.GoToMarker(t, "2")
|
|
f.VerifySignatureHelp(t, fourslash.VerifySignatureHelpOptions{Text: "MainButton(props: ButtonProps): JSX.Element", ParameterSpan: "props: ButtonProps"})
|
|
}
|