@@ -2,28 +2,32 @@ import renderInterfaceProperty from "../../../src/renderers/typescript/renderInt
2
2
3
3
describe ( "renderInterfaceProperty()" , ( ) => {
4
4
it ( "works with unrequired properties" , ( ) => {
5
- expect ( renderInterfaceProperty ( "property" , "type" , false , false ) . trim ( ) ) . toMatchInlineSnapshot (
5
+ expect ( renderInterfaceProperty ( "property" , "type" , false , false , false ) . trim ( ) ) . toMatchInlineSnapshot (
6
6
`"property?: type | undefined;"` ,
7
7
)
8
8
} )
9
9
10
10
it ( "works with required properties" , ( ) => {
11
- expect ( renderInterfaceProperty ( "property" , "type" , true , false ) . trim ( ) ) . toMatchInlineSnapshot (
11
+ expect ( renderInterfaceProperty ( "property" , "type" , true , false , false ) . trim ( ) ) . toMatchInlineSnapshot (
12
12
`"property: type;"` ,
13
13
)
14
14
} )
15
15
16
16
it ( "adds descriptions" , ( ) => {
17
- expect ( renderInterfaceProperty ( "property" , "type" , false , false , "Description" ) . trim ( ) )
17
+ expect ( renderInterfaceProperty ( "property" , "type" , false , false , false , "Description" ) . trim ( ) )
18
18
. toMatchInlineSnapshot ( `
19
19
"/** Description */
20
20
property?: type | undefined;"
21
21
` )
22
22
} )
23
23
24
24
it ( "supports localized fields" , ( ) => {
25
- expect ( renderInterfaceProperty ( "property" , "type" , false , true ) . trim ( ) ) . toMatchInlineSnapshot (
25
+ expect ( renderInterfaceProperty ( "property" , "type" , false , true , true ) . trim ( ) ) . toMatchInlineSnapshot (
26
26
`"property?: LocalizedField<type> | undefined;"` ,
27
27
)
28
+
29
+ expect ( renderInterfaceProperty ( "property" , "type" , false , true , false ) . trim ( ) ) . toMatchInlineSnapshot (
30
+ `"property?: DefaultLocalizedField<type> | undefined;"` ,
31
+ )
28
32
} )
29
33
} )
0 commit comments