@@ -30,14 +30,35 @@ describe('getHoverInformation', () => {
30
30
return getHoverInformation ( schema , query , point ) ;
31
31
}
32
32
33
- it ( 'provides leaf field information' , ( ) => {
34
- const actual = testHover (
35
- 'query { thing { testField } }' ,
36
- new Position ( 0 , 20 ) ,
37
- ) ;
38
- expect ( actual ) . toEqual (
39
- 'TestType.testField: String\n\nThis is field documentation for TestType.testField' ,
40
- ) ;
33
+ describe ( 'provides leaf field information' , ( ) => {
34
+ it ( 'when in middle of token' , ( ) => {
35
+ const actual = testHover (
36
+ 'query { thing { testField } }' ,
37
+ new Position ( 0 , 20 ) ,
38
+ ) ;
39
+ expect ( actual ) . toEqual (
40
+ 'TestType.testField: String\n\nThis is field documentation for TestType.testField' ,
41
+ ) ;
42
+ } ) ;
43
+
44
+ it ( 'when at start of token' , ( ) => {
45
+ const actual = testHover (
46
+ 'query { thing { testField } }' ,
47
+ new Position ( 0 , 16 ) ,
48
+ ) ;
49
+ expect ( actual ) . toEqual (
50
+ 'TestType.testField: String\n\nThis is field documentation for TestType.testField' ,
51
+ ) ;
52
+ } ) ;
53
+ it ( 'when at end of token' , ( ) => {
54
+ const actual = testHover (
55
+ 'query { thing { testField } }' ,
56
+ new Position ( 0 , 24 ) ,
57
+ ) ;
58
+ expect ( actual ) . toEqual (
59
+ 'TestType.testField: String\n\nThis is field documentation for TestType.testField' ,
60
+ ) ;
61
+ } ) ;
41
62
} ) ;
42
63
43
64
it ( 'provides aliased field information' , ( ) => {
0 commit comments