@@ -322,6 +322,36 @@ describe('GET /api/streak', () => {
322322 } ) ;
323323 } ) ;
324324
325+ describe ( 'hide parameters' , ( ) => {
326+ it ( 'removes the username title when hide_title=true' , async ( ) => {
327+ const response = await GET ( makeRequest ( { user : 'octocat' , hide_title : 'true' } ) ) ;
328+ const body = await response . text ( ) ;
329+
330+ expect ( body ) . not . toContain ( 'OCTOCAT' ) ;
331+ } ) ;
332+
333+ it ( 'keeps the username title when hide_title=false' , async ( ) => {
334+ const response = await GET ( makeRequest ( { user : 'octocat' , hide_title : 'false' } ) ) ;
335+ const body = await response . text ( ) ;
336+
337+ expect ( body ) . toContain ( 'OCTOCAT' ) ;
338+ } ) ;
339+
340+ it ( 'removes the stats section when hide_stats=true' , async ( ) => {
341+ const response = await GET ( makeRequest ( { user : 'octocat' , hide_stats : 'true' } ) ) ;
342+ const body = await response . text ( ) ;
343+
344+ expect ( body ) . not . toContain ( 'CURRENT_STREAK' ) ;
345+ } ) ;
346+
347+ it ( 'keeps the stats section when hide_stats=false' , async ( ) => {
348+ const response = await GET ( makeRequest ( { user : 'octocat' , hide_stats : 'false' } ) ) ;
349+ const body = await response . text ( ) ;
350+
351+ expect ( body ) . toContain ( 'CURRENT_STREAK' ) ;
352+ } ) ;
353+ } ) ;
354+
325355 describe ( 'error handling' , ( ) => {
326356 it ( 'returns 500 with SVG content type when fetchGitHubContributions throws' , async ( ) => {
327357 vi . mocked ( fetchGitHubContributions ) . mockRejectedValue ( new Error ( 'API is down' ) ) ;
0 commit comments