@@ -2,28 +2,32 @@ import renderInterfaceProperty from "../../../src/renderers/typescript/renderInt
22
33describe ( "renderInterfaceProperty()" , ( ) => {
44 it ( "works with unrequired properties" , ( ) => {
5- expect ( renderInterfaceProperty ( "property" , "type" , false , false ) . trim ( ) ) . toMatchInlineSnapshot (
5+ expect ( renderInterfaceProperty ( "property" , "type" , false , false , false ) . trim ( ) ) . toMatchInlineSnapshot (
66 `"property?: type | undefined;"` ,
77 )
88 } )
99
1010 it ( "works with required properties" , ( ) => {
11- expect ( renderInterfaceProperty ( "property" , "type" , true , false ) . trim ( ) ) . toMatchInlineSnapshot (
11+ expect ( renderInterfaceProperty ( "property" , "type" , true , false , false ) . trim ( ) ) . toMatchInlineSnapshot (
1212 `"property: type;"` ,
1313 )
1414 } )
1515
1616 it ( "adds descriptions" , ( ) => {
17- expect ( renderInterfaceProperty ( "property" , "type" , false , false , "Description" ) . trim ( ) )
17+ expect ( renderInterfaceProperty ( "property" , "type" , false , false , false , "Description" ) . trim ( ) )
1818 . toMatchInlineSnapshot ( `
1919 "/** Description */
2020 property?: type | undefined;"
2121 ` )
2222 } )
2323
2424 it ( "supports localized fields" , ( ) => {
25- expect ( renderInterfaceProperty ( "property" , "type" , false , true ) . trim ( ) ) . toMatchInlineSnapshot (
25+ expect ( renderInterfaceProperty ( "property" , "type" , false , true , true ) . trim ( ) ) . toMatchInlineSnapshot (
2626 `"property?: LocalizedField<type> | undefined;"` ,
2727 )
28+
29+ expect ( renderInterfaceProperty ( "property" , "type" , false , true , false ) . trim ( ) ) . toMatchInlineSnapshot (
30+ `"property?: DefaultLocalizedField<type> | undefined;"` ,
31+ )
2832 } )
2933} )
0 commit comments