File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -344,6 +344,39 @@ describe('useShikiHighlighter Hook', () => {
344344 expect ( style ) . not . toContain ( '--shiki-dark' ) ;
345345 } ) ;
346346 } ) ;
347+
348+ test ( 'multi-theme with two TextMate theme objects works' , async ( ) => {
349+ const code = 'const x = 1;' ;
350+ // Both values are TextMate theme objects (no strings)
351+ const lightTheme = {
352+ name : 'test-light' ,
353+ tokenColors : [
354+ { scope : 'keyword' , settings : { foreground : '#ff0000' } } ,
355+ ] ,
356+ } ;
357+ const darkTheme = {
358+ name : 'test-dark' ,
359+ tokenColors : [
360+ { scope : 'keyword' , settings : { foreground : '#00ff00' } } ,
361+ ] ,
362+ } ;
363+ const themes = { light : lightTheme , dark : darkTheme } ;
364+
365+ const { getByTestId } = renderComponent ( {
366+ code,
367+ language : 'javascript' ,
368+ theme : themes ,
369+ } ) ;
370+
371+ await waitFor ( ( ) => {
372+ const container = getByTestId ( 'highlighted' ) ;
373+ const pre = container . querySelector ( 'pre' ) ;
374+ // Should have multi-theme CSS variables
375+ const spans = container . querySelectorAll ( 'span[style*="--shiki-"]' ) ;
376+ expect ( spans . length ) . toBeGreaterThan ( 0 ) ;
377+ expect ( pre ) . toBeInTheDocument ( ) ;
378+ } ) ;
379+ } ) ;
347380 } ) ;
348381
349382 describe ( 'Rendering Options' , ( ) => {
You can’t perform that action at this time.
0 commit comments