@@ -52,15 +52,30 @@ describe('GET /api/v1/benchmarks', () => {
5252 expect ( res . status ) . toBe ( 200 ) ;
5353 const body = await res . json ( ) ;
5454 expect ( body ) . toEqual ( mockRows ) ;
55- expect ( mockGetLatestBenchmarks ) . toHaveBeenCalledWith ( 'mock-sql' , 'dsr1' , undefined ) ;
55+ expect ( mockGetLatestBenchmarks ) . toHaveBeenCalledWith ( 'mock-sql' , 'dsr1' , undefined , undefined ) ;
5656 } ) ;
5757
5858 it ( 'passes date param to query when provided' , async ( ) => {
5959 mockGetLatestBenchmarks . mockResolvedValueOnce ( [ ] ) ;
6060
6161 const res = await GET ( req ( '/api/v1/benchmarks?model=DeepSeek-R1-0528&date=2026-03-01' ) ) ;
6262 expect ( res . status ) . toBe ( 200 ) ;
63- expect ( mockGetLatestBenchmarks ) . toHaveBeenCalledWith ( 'mock-sql' , 'dsr1' , '2026-03-01' ) ;
63+ expect ( mockGetLatestBenchmarks ) . toHaveBeenCalledWith (
64+ 'mock-sql' ,
65+ 'dsr1' ,
66+ '2026-03-01' ,
67+ undefined ,
68+ ) ;
69+ } ) ;
70+
71+ it ( 'passes exact=true when query param set' , async ( ) => {
72+ mockGetLatestBenchmarks . mockResolvedValueOnce ( [ ] ) ;
73+
74+ const res = await GET (
75+ req ( '/api/v1/benchmarks?model=DeepSeek-R1-0528&date=2026-03-01&exact=true' ) ,
76+ ) ;
77+ expect ( res . status ) . toBe ( 200 ) ;
78+ expect ( mockGetLatestBenchmarks ) . toHaveBeenCalledWith ( 'mock-sql' , 'dsr1' , '2026-03-01' , true ) ;
6479 } ) ;
6580
6681 it ( 'returns 500 when query throws' , async ( ) => {
0 commit comments