From 673a86833aa070f94f6ec4c245f3ccb8309d36f7 Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 26 May 2020 17:51:00 -0700 Subject: [PATCH] update test names --- .../refactorAddOrRemoveBracesToArrowFunctionBody.ts | 7 ------- ...rAddOrRemoveBracesToArrowFunctionTriggerReason.ts | 8 ++++++++ .../fourslash/refactorExtractTypeTriggerReason.ts | 8 ++++++++ .../cases/fourslash/refactorExtractTypeValidSpans.ts | 12 ------------ 4 files changed, 16 insertions(+), 19 deletions(-) delete mode 100644 tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionBody.ts create mode 100644 tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionTriggerReason.ts create mode 100644 tests/cases/fourslash/refactorExtractTypeTriggerReason.ts delete mode 100644 tests/cases/fourslash/refactorExtractTypeValidSpans.ts diff --git a/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionBody.ts b/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionBody.ts deleted file mode 100644 index 587f26ded43..00000000000 --- a/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionBody.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -//// const a = (a: number) => { return/*a*//*b*/ a; }; - -// an invoked refactor request for a cursor in the body should return a refactor -goTo.select("a", "b"); -verify.refactorAvailableForTriggerReason("invoked","Add or remove braces in an arrow function", "Remove braces from arrow function"); \ No newline at end of file diff --git a/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionTriggerReason.ts b/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionTriggerReason.ts new file mode 100644 index 00000000000..a1e940fa7b1 --- /dev/null +++ b/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionTriggerReason.ts @@ -0,0 +1,8 @@ +/// + +//// const a = (a: number) => { return/*a*//*b*/ a; }; + +// Only offer refactor for empty span if explicity requested +goTo.select("a", "b"); +verify.not.refactorAvailableForTriggerReason("implicit", "Add or remove braces in an arrow function"); +verify.refactorAvailableForTriggerReason("invoked", "Add or remove braces in an arrow function", "Remove braces from arrow function"); diff --git a/tests/cases/fourslash/refactorExtractTypeTriggerReason.ts b/tests/cases/fourslash/refactorExtractTypeTriggerReason.ts new file mode 100644 index 00000000000..019996fbbd0 --- /dev/null +++ b/tests/cases/fourslash/refactorExtractTypeTriggerReason.ts @@ -0,0 +1,8 @@ +/// + +//// var x: str/*a*//*b*/ing; + +// Only offer refactor for empty span if explicity requested +goTo.select("a", "b"); +verify.not.refactorAvailableForTriggerReason("implicit", "Extract type"); +verify.refactorAvailableForTriggerReason("invoked", "Extract type"); \ No newline at end of file diff --git a/tests/cases/fourslash/refactorExtractTypeValidSpans.ts b/tests/cases/fourslash/refactorExtractTypeValidSpans.ts deleted file mode 100644 index a1030a44c43..00000000000 --- a/tests/cases/fourslash/refactorExtractTypeValidSpans.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// - -//// var x: /*1a*/{ a?:/*2a*/ number, b?: string/*2b*//*3a*//*3b*/ }/*1b*/ = { }; - -// Only offer refactor for empty span if explicity requested -goTo.select("3a", "3b"); -verify.refactorNotAvailableForTriggerReason("implicit", "Extract type"); - -for (const m of ["1", "2", "3"]) { - goTo.select(m + "a", m + "b"); - verify.refactorAvailableForTriggerReason("invoked", "Extract type"); -}