File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -355,6 +355,38 @@ describe('generateSVG', () => {
355355 expect ( svg ) . toContain ( 'CURRENT_STREAK' ) ;
356356 } ) ;
357357
358+ describe ( 'LoC Mode' , ( ) => {
359+ it ( 'renders towers when LoC data exists (not ghost city)' , ( ) => {
360+ const locCalendar : ContributionCalendar = {
361+ totalContributions : 0 ,
362+ weeks : [
363+ {
364+ contributionDays : [
365+ {
366+ contributionCount : 0 ,
367+ locAdditions : 50 ,
368+ locDeletions : 10 ,
369+ date : '2024-06-10' ,
370+ } ,
371+ ] ,
372+ } ,
373+ ] ,
374+ } as ContributionCalendar ;
375+
376+ const svg = generateSVG (
377+ mockStats ,
378+ { user : 'avi' , mode : 'loc' } as unknown as BadgeParams ,
379+ locCalendar
380+ ) ;
381+
382+ // Should contain towers (LoC data exists, so it should not render the ghost city)
383+ expect ( svg ) . toContain ( 'class="cp-tower' ) ;
384+
385+ // Should NOT contain stroke-width="0.5" (the ghost city marker)
386+ expect ( svg ) . not . toContain ( 'stroke-width="0.5"' ) ;
387+ } ) ;
388+ } ) ;
389+
358390 // ── Auto-theme (prefers-color-scheme) tests ──────────────────────────────
359391 // These verify that theme=auto produces an SVG that switches between light
360392 // and dark color palettes using CSS custom properties and a media query,
You can’t perform that action at this time.
0 commit comments