1
1
import CompletionProvider from '@web-actions/completion/CompletionProvider' ;
2
2
import FakeEditor from '@web-actions/completion/__test__/FakeEditor' ;
3
- import { MyAction } from '@web-actions/completion/__test__/FakeMetadataClient' ;
3
+ import { MyActionGroup } from '@web-actions/completion/__test__/FakeMetadataClient' ;
4
4
import { givenEditor } from '@web-actions/completion/__test__/CompletionTester' ;
5
- import { MiskWebActionDefinition } from '@web-actions/api/responseTypes' ;
5
+ import { ActionGroup } from '@web-actions/api/responseTypes' ;
6
6
7
- export function providerWithAction (
8
- action : MiskWebActionDefinition ,
9
- ) : CompletionProvider {
7
+ export function providerWithAction ( action : ActionGroup ) : CompletionProvider {
10
8
const p = new CompletionProvider ( ) ;
11
9
p . setSelection ( action ) ;
12
10
return p ;
13
11
}
14
12
15
13
test ( 'completion from object body' , async ( ) => {
16
14
const editor = new FakeEditor ( ) ;
17
- editor . completions = providerWithAction ( MyAction ) ;
15
+ editor . completions = providerWithAction ( MyActionGroup ) ;
18
16
19
17
editor . setTextWithCursor ( `
20
18
{
@@ -30,7 +28,7 @@ test('completion from object body', async () => {
30
28
31
29
test ( 'completion from object body within field name' , async ( ) => {
32
30
const editor = new FakeEditor ( ) ;
33
- editor . completions = providerWithAction ( MyAction ) ;
31
+ editor . completions = providerWithAction ( MyActionGroup ) ;
34
32
editor . setTextWithCursor ( `
35
33
{
36
34
"|"
@@ -45,7 +43,7 @@ test('completion from object body within field name', async () => {
45
43
46
44
test ( 'completion from object body within field value' , async ( ) => {
47
45
const editor = new FakeEditor ( ) ;
48
- editor . completions = providerWithAction ( MyAction ) ;
46
+ editor . completions = providerWithAction ( MyActionGroup ) ;
49
47
editor . setTextWithCursor ( `
50
48
{
51
49
"text": |
@@ -60,7 +58,7 @@ test('completion from object body within field value', async () => {
60
58
61
59
test ( 'completion from literal in quotes' , async ( ) => {
62
60
const editor = new FakeEditor ( ) ;
63
- editor . completions = providerWithAction ( MyAction ) ;
61
+ editor . completions = providerWithAction ( MyActionGroup ) ;
64
62
editor . setTextWithCursor ( `
65
63
{
66
64
"text": "|",
@@ -75,13 +73,6 @@ test('completion from literal in quotes', async () => {
75
73
76
74
test ( 'completion from enum' , async ( ) => {
77
75
const startingWith = [
78
- // `
79
- // {
80
- // "enum": "|",
81
- // }`, `
82
- // {
83
- // "enum": |,
84
- // }`,
85
76
`
86
77
{
87
78
"enum": |
0 commit comments