Skip to content

Commit

Permalink
Refactor test, add new (failing) test for dotted with a desirable sni…
Browse files Browse the repository at this point in the history
…ppet completion
  • Loading branch information
jakebailey committed Jan 4, 2022
1 parent f158365 commit 0990c31
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
33 changes: 33 additions & 0 deletions tests/cases/fourslash/jsxTagNameDottedAttributeSnippet.ts
@@ -0,0 +1,33 @@
/// <reference path="fourslash.ts" />
//@Filename: file.tsx
////interface NestedInterface {
//// Foo: NestedInterface;
//// (props: {className?: string}): any;
////}
////
////declare const Foo: NestedInterface;
////
////function fn1() {
//// return <Foo>
//// <Foo /*1*/
//// </Foo>
////}
////function fn2() {
//// return <Foo>
//// <Foo.Foo /*2*/
//// </Foo>
////}

verify.completions(
{
marker: test.markers(),
includes: [
{ name: "className", insertText: 'className={$1}', isSnippet: true, sortText: completion.SortText.OptionalMember }
],
preferences: {
jsxAttributeCompletionStyle: "braces",
includeCompletionsWithSnippetText: true,
includeCompletionsWithInsertText: true,
},
}
)
10 changes: 5 additions & 5 deletions tests/cases/fourslash/jsxTagNameDottedNoSnippet.ts
Expand Up @@ -38,9 +38,9 @@
//// </Foo>
////}

for (const marker of test.markers()) {
verify.completions({
marker,
verify.completions(
{
marker: test.markers(),
includes: [
{ name: "Foo", insertText: undefined, isSnippet: undefined }
],
Expand All @@ -49,5 +49,5 @@ for (const marker of test.markers()) {
includeCompletionsWithSnippetText: true,
includeCompletionsWithInsertText: true,
},
})
}
}
)

0 comments on commit 0990c31

Please sign in to comment.