11import { extendExpect } from './expect-extensions' ;
22import {
33 customField ,
4+ customFieldPickListValues ,
45 customObjectGenerator ,
56 generateDocs ,
67 unparsedFieldBundleFromRawString ,
@@ -46,7 +47,7 @@ describe('Generates Custom Object documentation', () => {
4647 expect ( result ) . documentationBundleHasLength ( 1 ) ;
4748 assertEither ( result , ( data ) => expect ( data ) . firstDocContains ( '`TestObject__c`' ) ) ;
4849 } ) ;
49-
50+
5051 it ( 'displays the Fields heading if fields are present' , async ( ) => {
5152 const customObjectBundle = unparsedObjectBundleFromRawString ( {
5253 rawContent : customObjectGenerator ( ) ,
@@ -64,6 +65,25 @@ describe('Generates Custom Object documentation', () => {
6465 assertEither ( result , ( data ) => expect ( data ) . firstDocContains ( '## Fields' ) ) ;
6566 } ) ;
6667
68+ it ( 'displays the pick list values name' , async ( ) => {
69+ const customObjectBundle = unparsedObjectBundleFromRawString ( {
70+ rawContent : customObjectGenerator ( ) ,
71+ filePath : 'src/object/TestObject__c.object-meta.xml' ,
72+ } ) ;
73+
74+ const customFieldBundle = unparsedFieldBundleFromRawString ( {
75+ rawContent : customFieldPickListValues ,
76+ filePath : 'src/object/TestField__c.field-meta.xml' ,
77+ parentName : 'TestObject__c' ,
78+ } ) ;
79+
80+ const result = await generateDocs ( [ customObjectBundle , customFieldBundle ] ) ( ) ;
81+ expect ( result ) . documentationBundleHasLength ( 1 ) ;
82+ assertEither ( result , ( data ) => expect ( data ) . firstDocContains ( '* Staging' ) ) ;
83+ assertEither ( result , ( data ) => expect ( data ) . firstDocContains ( '* Active' ) ) ;
84+ assertEither ( result , ( data ) => expect ( data ) . firstDocContains ( '* Inactive' ) ) ;
85+ } ) ;
86+
6787 it ( 'does not display the Fields heading if no fields are present' , async ( ) => {
6888 const input = unparsedObjectBundleFromRawString ( {
6989 rawContent : customObjectGenerator ( ) ,
0 commit comments