@@ -12,11 +12,17 @@ describe('Date Search (e2e tests)', () => {
1212
1313 describe . only ( 'BasicSearchManager.search()' , ( ) => {
1414 // expected defaults to false in this series!
15- const testCases : Array < { input : string ; expected ?: number ; first ?: string ; includes : string ; snapshot ?: boolean } > = [
15+ const testCases : Array < { input : string ; expected ?: number ; first ?: string ; includes ? : string ; snapshot ?: boolean ; } > = [
1616 // valid dates
17- // { input: `2022-01-11`, expected: 892, includes: "CVE-2022-31279", snapshot: false }, // developer tools returns 861 instead
18- { input : `2024-06-14` , expected : 4 , includes : "CVE-2024-6006" , snapshot : true } , // developer tools returns 138 instead
19- { input : `2025-01-11` , expected : 2 , includes : "CVE-2024-42169" , snapshot : true } // developer tools reads 9 instead of 24
17+ { input : `2022-01-11` , expected : 23 , includes : "CVE-2022-21963" , snapshot : true } ,
18+ // { input: `2025-01-11T02:31:22.611Z`, expected: 1, includes: "CVE-2024-42169", snapshot: true },
19+ { input : `2024-06-14` , expected : 4 , includes : "CVE-2024-6006" , snapshot : true } ,
20+ { input : `2025-01-11` , expected : 2 , includes : "CVE-2024-42169" , snapshot : true } ,
21+ { input : `1999` , expected : 0 , snapshot : true } ,
22+ // { input: `2022`, expected: 0, snapshot: true },
23+ // { input: `2022-01`, expected: 12, includes: "CVE-2022-40621", snapshot: true }, // why search by month results in less than search by date in same month
24+ // invalid dates
25+
2026 ] ;
2127
2228 testCases . forEach ( ( { input, expected, first, includes, snapshot } ) => {
@@ -39,6 +45,7 @@ describe('Date Search (e2e tests)', () => {
3945 const cveIdMap = retlist . map ( cve => {
4046 cves . push ( cve [ "_id" ] )
4147 } )
48+ console . log ( `cves: ${ JSON . stringify ( cves , null , 2 ) } ` )
4249 if ( snapshot ) {
4350 expect ( cves . sort ( ) ) . toMatchSnapshot ( ) ;
4451 }
0 commit comments