@@ -130,82 +130,82 @@ describe('NPMFakerService Shared Intstance Tests', () => {
130130
131131 } ) ;
132132
133- // describe('buildMultiSelectPicklistRecipeValueByXMLFieldDetail', () => {
133+ describe ( 'buildMultiSelectPicklistRecipeValueByXMLFieldDetail' , ( ) => {
134134
135- // test('given expected list of choices, returns expected multiselect picklist faker value', () => {
135+ test ( 'given expected list of choices, returns expected multiselect picklist faker value' , ( ) => {
136136
137- // const possibleChoices: string[] = ['apple', 'orange', 'banana'];
138- // const expectedRecipeValue = `faker.helpers.arrayElements(['apple','orange','banana'])`;
139- // const actualFakerValue = npmFakerService.buildMultiSelectPicklistRecipeValueByXMLFieldDetail(possibleChoices);
137+ const possibleChoices : string [ ] = [ 'apple' , 'orange' , 'banana' ] ;
138+ const expectedRecipeValue = `faker.helpers.arrayElements(['apple','orange','banana'])` ;
139+ const actualFakerValue = npmFakerService . buildMultiSelectPicklistRecipeValueByXMLFieldDetail ( possibleChoices ) ;
140140
141- // expect(actualFakerValue).toBe(expectedRecipeValue);
142- // });
141+ expect ( actualFakerValue ) . toBe ( expectedRecipeValue ) ;
142+ } ) ;
143143
144- // });
144+ } ) ;
145145
146- // describe('buildDependentPicklistRecipeFakerValue', () => {
146+ describe ( 'buildDependentPicklistRecipeFakerValue' , ( ) => {
147147
148- // test('given expected controlling value picklist options, returns expected dependent picklist faker value', () => {
148+ test ( 'given expected controlling value picklist options, returns expected dependent picklist faker value' , ( ) => {
149149
150- // const expectedControllingValueToPicklistOptions: Record<string, string[]> = {
151- // Toyota: ["Corolla", "Camry", "Prius"],
152- // Ford: ["F-150", "Mustang", "Explorer"],
153- // Honda: ["Civic", "Accord", "Pilot"],
154- // Tesla: ["Model S", "Model 3", "Model X"],
155- // };
150+ const expectedControllingValueToPicklistOptions : Record < string , string [ ] > = {
151+ Toyota : [ "Corolla" , "Camry" , "Prius" ] ,
152+ Ford : [ "F-150" , "Mustang" , "Explorer" ] ,
153+ Honda : [ "Civic" , "Accord" , "Pilot" ] ,
154+ Tesla : [ "Model S" , "Model 3" , "Model X" ] ,
155+ } ;
156156
157- // const controllingField = "CarBrand__c";
157+ const controllingField = "CarBrand__c" ;
158158
159- // const expectedDependentPicklistRecipeValue =`
160- // if:
161- // - choice:
162- // when: "${controllingField} == 'Toyota'"
163- // pick:
164- // random_choice:
165- // - Corolla
166- // - Camry
167- // - Prius
168- // - choice:
169- // when: "${controllingField} == 'Ford'"
170- // pick:
171- // random_choice:
172- // - F-150
173- // - Mustang
174- // - Explorer
175- // - choice:
176- // when: "${controllingField} == 'Honda'"
177- // pick:
178- // random_choice:
179- // - Civic
180- // - Accord
181- // - Pilot
182- // - choice:
183- // when: "${controllingField} == 'Tesla'"
184- // pick:
185- // random_choice:
186- // - Model S
187- // - Model 3
188- // - Model X`;
189-
190-
191- // const actualFakerValue = npmFakerService.buildDependentPicklistRecipeFakerValue(expectedControllingValueToPicklistOptions, controllingField);
192-
193- // expect(actualFakerValue).toBe(expectedDependentPicklistRecipeValue);
194- // });
159+ const expectedDependentPicklistRecipeValue = `
160+ if:
161+ - choice:
162+ when: "${ controllingField } == 'Toyota'"
163+ pick:
164+ random_choice:
165+ - Corolla
166+ - Camry
167+ - Prius
168+ - choice:
169+ when: "${ controllingField } == 'Ford'"
170+ pick:
171+ random_choice:
172+ - F-150
173+ - Mustang
174+ - Explorer
175+ - choice:
176+ when: "${ controllingField } == 'Honda'"
177+ pick:
178+ random_choice:
179+ - Civic
180+ - Accord
181+ - Pilot
182+ - choice:
183+ when: "${ controllingField } == 'Tesla'"
184+ pick:
185+ random_choice:
186+ - Model S
187+ - Model 3
188+ - Model X` ;
189+
190+
191+ const actualFakerValue = npmFakerService . buildDependentPicklistRecipeFakerValue ( expectedControllingValueToPicklistOptions , controllingField ) ;
192+
193+ expect ( actualFakerValue ) . toBe ( expectedDependentPicklistRecipeValue ) ;
194+ } ) ;
195195
196- // });
196+ } ) ;
197197
198- // describe('buildPicklistRecipeValueByXMLFieldDetail', () => {
198+ describe ( 'buildPicklistRecipeValueByXMLFieldDetail' , ( ) => {
199199
200- // test('given expected list of choices, returns expected picklist faker value', () => {
200+ test ( 'given expected list of choices, returns expected picklist faker value' , ( ) => {
201201
202- // const possibleChoices: string[] = ['apple', 'orange', 'banana'];
203- // const expectedRecipeValue = `faker.helpers.arrayElement(['apple','orange','banana'])`;
204- // const actualFakerValue = npmFakerService.buildPicklistRecipeValueByXMLFieldDetail(possibleChoices);
202+ const possibleChoices : string [ ] = [ 'apple' , 'orange' , 'banana' ] ;
203+ const expectedRecipeValue = `faker.helpers.arrayElement(['apple','orange','banana'])` ;
204+ const actualFakerValue = npmFakerService . buildPicklistRecipeValueByXMLFieldDetail ( possibleChoices ) ;
205205
206- // expect(actualFakerValue).toBe(expectedRecipeValue);
207- // });
206+ expect ( actualFakerValue ) . toBe ( expectedRecipeValue ) ;
207+ } ) ;
208208
209- // });
209+ } ) ;
210210
211211} ) ;
0 commit comments