@@ -10,6 +10,9 @@ const modelYearString = '2018'
1010const modelYearNumber = 2018
1111const modelYear = modelYearNumber
1212
13+ // https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/{vin}?format=json
14+ // https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/{vin}?modelYear={modelYear}&format=json
15+
1316const baseUrl = 'https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin'
1417const mockUrl = `${ baseUrl } /${ vin } ?format=json`
1518const mockUrlModelYear = `${ baseUrl } /${ vin } ?modelYear=${ modelYear } &format=json`
@@ -44,33 +47,33 @@ describe('decodeVin()', () => {
4447 test . each < TestEach > ( [
4548 // vin with no options
4649 {
47- description : 'vin with no options' ,
50+ description : 'vin and no options' ,
4851 args : [ vin ] ,
4952 expectedUrl : mockUrl ,
5053 } ,
5154 {
52- description : 'vin with no options and doFetch = true' ,
55+ description : 'vin, no options, and doFetch = true' ,
5356 args : [ vin , true ] ,
5457 expectedUrl : mockUrl ,
5558 } ,
5659 // options.modelYear
5760 {
58- description : 'options.modelYear as string' ,
61+ description : 'vin and options.modelYear as string' ,
5962 args : [ vin , { modelYear : modelYearString } ] ,
6063 expectedUrl : mockUrlModelYear ,
6164 } ,
6265 {
63- description : 'options.modelYear as string and doFetch = true' ,
66+ description : 'vin, options.modelYear as string, and doFetch = true' ,
6467 args : [ vin , { modelYear : modelYearString } , true ] ,
6568 expectedUrl : mockUrlModelYear ,
6669 } ,
6770 {
68- description : 'options.modelYear as number' ,
71+ description : 'vin and options.modelYear as number' ,
6972 args : [ vin , { modelYear : modelYearNumber } ] ,
7073 expectedUrl : mockUrlModelYear ,
7174 } ,
7275 {
73- description : 'options.modelYear as number and doFetch = true' ,
76+ description : 'vin, options.modelYear as number, and doFetch = true' ,
7477 args : [ vin , { modelYear : modelYearNumber } , true ] ,
7578 expectedUrl : mockUrlModelYear ,
7679 } ,
@@ -96,12 +99,12 @@ describe('decodeVin()', () => {
9699 } ,
97100 // options.modelYear
98101 {
99- description : 'options.modelYear as string and doFetch = false' ,
102+ description : 'vin, options.modelYear as string and doFetch = false' ,
100103 args : [ vin , { modelYear : modelYearString } , false ] ,
101104 expectedUrl : mockUrlModelYear ,
102105 } ,
103106 {
104- description : 'options.modelYear as number and doFetch = false' ,
107+ description : 'vin, options.modelYear as number and doFetch = false' ,
105108 args : [ vin , { modelYear : modelYearNumber } , false ] ,
106109 expectedUrl : mockUrlModelYear ,
107110 } ,
@@ -338,9 +341,13 @@ describe.skip('IDE Tooltips - manual test of results type on hover', async () =>
338341 /******Expected Tooltip*******\
339342 const result_x: string
340343 ******************************/
344+
345+ /* https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/{vin}?format=json */
341346 const result_1 = await decodeVin ( vin , false )
342347 const result_2 = await decodeVin ( vin , { } , false )
343348 const result_3 = await decodeVin ( vin , undefined , false )
349+
350+ /* https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/{vin}?modelYear={modelYear}&format=json */
344351 const result_4 = await decodeVin ( vin , { modelYear : modelYearString } , false )
345352 const result_5 = await decodeVin ( vin , { modelYear : modelYearNumber } , false )
346353
0 commit comments