Fix and consolidate tsx rename tests
This commit is contained in:
parent
d99a46e8ce
commit
151023c69b
8 changed files with 10 additions and 187 deletions
|
@ -1,40 +0,0 @@
|
||||||
/// <reference path='fourslash.ts' />
|
|
||||||
|
|
||||||
//@Filename: file.tsx
|
|
||||||
// @jsx: preserve
|
|
||||||
// @noLib: true
|
|
||||||
|
|
||||||
//// declare module JSX {
|
|
||||||
//// interface Element { }
|
|
||||||
//// interface IntrinsicElements {
|
|
||||||
//// }
|
|
||||||
//// interface ElementAttributesProperty { props; }
|
|
||||||
//// }
|
|
||||||
//// interface ClickableProps {
|
|
||||||
//// children?: string;
|
|
||||||
//// className?: string;
|
|
||||||
//// }
|
|
||||||
//// interface ButtonProps extends ClickableProps {
|
|
||||||
//// onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
|
|
||||||
//// }
|
|
||||||
//// interface LinkProps extends ClickableProps {
|
|
||||||
//// [|goTo|]: string;
|
|
||||||
//// }
|
|
||||||
//// declare function MainButton(buttonProps: ButtonProps): JSX.Element;
|
|
||||||
//// declare function MainButton(linkProps: LinkProps): JSX.Element;
|
|
||||||
//// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
|
|
||||||
//// let opt = <MainButton />;
|
|
||||||
//// let opt = <MainButton children="chidlren" />;
|
|
||||||
//// let opt = <MainButton onClick={()=>{}} />;
|
|
||||||
//// let opt = <MainButton onClick={()=>{}} ignore-prop />;
|
|
||||||
//// let opt = <MainButton [|goTo|]="goTo" />;
|
|
||||||
//// let opt = <MainButton [|goTo|] />;
|
|
||||||
//// let opt = <MainButton wrong />;
|
|
||||||
|
|
||||||
|
|
||||||
let ranges = test.ranges();
|
|
||||||
verify.assertHasRanges(ranges);
|
|
||||||
for (let range of ranges) {
|
|
||||||
goTo.position(range.start);
|
|
||||||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
/// <reference path='fourslash.ts' />
|
|
||||||
|
|
||||||
//@Filename: file.tsx
|
|
||||||
// @jsx: preserve
|
|
||||||
// @noLib: true
|
|
||||||
|
|
||||||
//// declare module JSX {
|
|
||||||
//// interface Element { }
|
|
||||||
//// interface IntrinsicElements {
|
|
||||||
//// }
|
|
||||||
//// interface ElementAttributesProperty { props; }
|
|
||||||
//// }
|
|
||||||
//// interface ClickableProps {
|
|
||||||
//// children?: string;
|
|
||||||
//// className?: string;
|
|
||||||
//// }
|
|
||||||
//// interface ButtonProps extends ClickableProps {
|
|
||||||
//// [|onClick|](event?: React.MouseEvent<HTMLButtonElement>): void;
|
|
||||||
//// }
|
|
||||||
//// interface LinkProps extends ClickableProps {
|
|
||||||
//// goTo: string;
|
|
||||||
//// }
|
|
||||||
//// declare function MainButton(buttonProps: ButtonProps): JSX.Element;
|
|
||||||
//// declare function MainButton(linkProps: LinkProps): JSX.Element;
|
|
||||||
//// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
|
|
||||||
//// let opt = <MainButton />;
|
|
||||||
//// let opt = <MainButton children="chidlren" />;
|
|
||||||
//// let opt = <MainButton [|onClick|]={()=>{}} />;
|
|
||||||
//// let opt = <MainButton [|onClick|]={()=>{}} ignore-prop />;
|
|
||||||
//// let opt = <MainButton goTo="goTo" />;
|
|
||||||
//// let opt = <MainButton wrong />;
|
|
||||||
|
|
||||||
|
|
||||||
let ranges = test.ranges();
|
|
||||||
verify.assertHasRanges(ranges);
|
|
||||||
for (let range of ranges) {
|
|
||||||
goTo.position(range.start);
|
|
||||||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
/// <reference path='fourslash.ts' />
|
|
||||||
|
|
||||||
//@Filename: file.tsx
|
|
||||||
// @jsx: preserve
|
|
||||||
// @noLib: true
|
|
||||||
|
|
||||||
//// declare module JSX {
|
|
||||||
//// interface Element { }
|
|
||||||
//// interface IntrinsicElements {
|
|
||||||
//// }
|
|
||||||
//// interface ElementAttributesProperty { props; }
|
|
||||||
//// }
|
|
||||||
//// interface ClickableProps {
|
|
||||||
//// children?: string;
|
|
||||||
//// className?: string;
|
|
||||||
//// }
|
|
||||||
//// interface ButtonProps extends ClickableProps {
|
|
||||||
//// onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
|
|
||||||
//// }
|
|
||||||
//// interface LinkProps extends ClickableProps {
|
|
||||||
//// goTo: string;
|
|
||||||
//// }
|
|
||||||
//// declare function MainButton(buttonProps: ButtonProps): JSX.Element;
|
|
||||||
//// declare function MainButton(linkProps: LinkProps): JSX.Element;
|
|
||||||
//// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
|
|
||||||
//// let opt = <MainButton />;
|
|
||||||
//// let opt = <MainButton children="chidlren" />;
|
|
||||||
//// let opt = <MainButton onClick={()=>{}} />;
|
|
||||||
//// let opt = <MainButton onClick={()=>{}} ignore-prop />;
|
|
||||||
//// let opt = <MainButton goTo="goTo" />;
|
|
||||||
//// let opt = <MainButton [|wrong|] />;
|
|
||||||
|
|
||||||
|
|
||||||
let ranges = test.ranges();
|
|
||||||
verify.assertHasRanges(ranges);
|
|
||||||
for (let range of ranges) {
|
|
||||||
goTo.position(range.start);
|
|
||||||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
/// <reference path='fourslash.ts' />
|
|
||||||
|
|
||||||
//@Filename: file.tsx
|
|
||||||
// @jsx: preserve
|
|
||||||
// @noLib: true
|
|
||||||
|
|
||||||
//// declare module JSX {
|
|
||||||
//// interface Element { }
|
|
||||||
//// interface IntrinsicElements {
|
|
||||||
//// }
|
|
||||||
//// interface ElementAttributesProperty { props; }
|
|
||||||
//// }
|
|
||||||
//// interface ClickableProps {
|
|
||||||
//// children?: string;
|
|
||||||
//// className?: string;
|
|
||||||
//// }
|
|
||||||
//// interface ButtonProps extends ClickableProps {
|
|
||||||
//// onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
|
|
||||||
//// }
|
|
||||||
//// interface LinkProps extends ClickableProps {
|
|
||||||
//// goTo: string;
|
|
||||||
//// }
|
|
||||||
//// declare function MainButton(buttonProps: ButtonProps): JSX.Element;
|
|
||||||
//// declare function MainButton(linkProps: LinkProps): JSX.Element;
|
|
||||||
//// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
|
|
||||||
//// let opt = <MainButton />;
|
|
||||||
//// let opt = <MainButton children="chidlren" />;
|
|
||||||
//// let opt = <MainButton onClick={()=>{}} />;
|
|
||||||
//// let opt = <MainButton onClick={()=>{}} [|ignore-prop|] />;
|
|
||||||
//// let opt = <MainButton goTo="goTo" />;
|
|
||||||
//// let opt = <MainButton wrong />;
|
|
||||||
|
|
||||||
|
|
||||||
let ranges = test.ranges();
|
|
||||||
verify.assertHasRanges(ranges);
|
|
||||||
for (let range of ranges) {
|
|
||||||
goTo.position(range.start);
|
|
||||||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
|
|
||||||
}
|
|
|
@ -22,9 +22,4 @@
|
||||||
//// let opt3 = <[|Opt|] wrong />;
|
//// let opt3 = <[|Opt|] wrong />;
|
||||||
//// let opt4 = <[|Opt|] propx={100} propString="hi" />;
|
//// let opt4 = <[|Opt|] propx={100} propString="hi" />;
|
||||||
|
|
||||||
let ranges = test.ranges();
|
verify.rangesAreRenameLocations();
|
||||||
verify.assertHasRanges(ranges);
|
|
||||||
for (let range of ranges) {
|
|
||||||
goTo.position(range.start);
|
|
||||||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
|
|
||||||
}
|
|
||||||
|
|
|
@ -21,9 +21,4 @@
|
||||||
//// let opt2 = <Opt [|propx|]={100} optional/>;
|
//// let opt2 = <Opt [|propx|]={100} optional/>;
|
||||||
//// let opt3 = <Opt wrong />;
|
//// let opt3 = <Opt wrong />;
|
||||||
|
|
||||||
let ranges = test.ranges();
|
verify.rangesAreRenameLocations();
|
||||||
verify.assertHasRanges(ranges);
|
|
||||||
for (let range of ranges) {
|
|
||||||
goTo.position(range.start);
|
|
||||||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
|
|
||||||
}
|
|
||||||
|
|
|
@ -23,9 +23,4 @@
|
||||||
//// let opt3 = <Opt [|wrong|] />;
|
//// let opt3 = <Opt [|wrong|] />;
|
||||||
//// let opt4 = <Opt propx={100} propString="hi" />;
|
//// let opt4 = <Opt propx={100} propString="hi" />;
|
||||||
|
|
||||||
let ranges = test.ranges();
|
verify.rangesAreRenameLocations();
|
||||||
verify.assertHasRanges(ranges);
|
|
||||||
for (let range of ranges) {
|
|
||||||
goTo.position(range.start);
|
|
||||||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
|
|
||||||
}
|
|
||||||
|
|
|
@ -15,24 +15,19 @@
|
||||||
//// className?: string;
|
//// className?: string;
|
||||||
//// }
|
//// }
|
||||||
//// interface ButtonProps extends ClickableProps {
|
//// interface ButtonProps extends ClickableProps {
|
||||||
//// onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
|
//// [|onClick|](event?: React.MouseEvent<HTMLButtonElement>): void;
|
||||||
//// }
|
//// }
|
||||||
//// interface LinkProps extends ClickableProps {
|
//// interface LinkProps extends ClickableProps {
|
||||||
//// goTo: string;
|
//// [|goTo|]: string;
|
||||||
//// }
|
//// }
|
||||||
//// declare function [|MainButton|](buttonProps: ButtonProps): JSX.Element;
|
//// declare function [|MainButton|](buttonProps: ButtonProps): JSX.Element;
|
||||||
//// declare function [|MainButton|](linkProps: LinkProps): JSX.Element;
|
//// declare function [|MainButton|](linkProps: LinkProps): JSX.Element;
|
||||||
//// declare function [|MainButton|](props: ButtonProps | LinkProps): JSX.Element;
|
//// declare function [|MainButton|](props: ButtonProps | LinkProps): JSX.Element;
|
||||||
//// let opt = <[|MainButton|] />;
|
//// let opt = <[|MainButton|] />;
|
||||||
//// let opt = <[|MainButton|] children="chidlren" />;
|
//// let opt = <[|MainButton|] children="chidlren" />;
|
||||||
//// let opt = <[|MainButton|] onClick={()=>{}} />;
|
//// let opt = <[|MainButton|] [|onClick|]={()=>{}} />;
|
||||||
//// let opt = <[|MainButton|] onClick={()=>{}} ignore-prop />;
|
//// let opt = <[|MainButton|] [|onClick|]={()=>{}} [|ignore-prop|] />;
|
||||||
//// let opt = <[|MainButton|] goTo="goTo" />;
|
//// let opt = <[|MainButton|] [|goTo|]="goTo" />;
|
||||||
//// let opt = <[|MainButton|] wrong />;
|
//// let opt = <[|MainButton|] [|wrong|] />;
|
||||||
|
|
||||||
let ranges = test.ranges();
|
verify.rangesWithSameTextAreRenameLocations();
|
||||||
verify.assertHasRanges(ranges);
|
|
||||||
for (let range of ranges) {
|
|
||||||
goTo.position(range.start);
|
|
||||||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue