@@ -89,8 +89,8 @@ test.describe('Theme switching', () => {
8989 test ( 'Theme CTA can be removed via filter hook' , async ( { page, editor } ) => {
9090 // Use wp.hooks.addFilter to replace themes with only Nord
9191 await page . evaluate ( ( ) => {
92- // @ts -expect-error wp is global in WP admin
93- window . wp . hooks . addFilter (
92+ // biome-ignore lint/suspicious/noExplicitAny: WP global
93+ ( window as any ) . wp . hooks . addFilter (
9494 'blocks.codeBlockPro.themes' ,
9595 'test/override' ,
9696 ( ) => ( {
@@ -112,17 +112,10 @@ test.describe('Theme switching', () => {
112112 await expect ( ctaLinks ) . toHaveCount ( 0 ) ;
113113 } ) ;
114114
115- test ( 'Random theme renders without errors' , async ( { page, editor } ) => {
115+ test ( 'Theme renders without errors' , async ( { page, editor } ) => {
116116 await addCode ( editor , 'const x = 1;' ) ;
117- await openPanel ( page , 'Theme' ) ;
118- const themeButtons = page . locator ( 'button[id^="code-block-pro-theme-"]' ) ;
119- const count = await themeButtons . count ( ) ;
120- expect ( count ) . toBeGreaterThan ( 0 ) ;
121- const randomIndex = Math . floor ( Math . random ( ) * Math . min ( count , 10 ) ) ;
122- const btn = themeButtons . nth ( randomIndex ) ;
123- await btn . scrollIntoViewIfNeeded ( ) ;
124- await btn . click ( ) ;
125- // Should not show loading or error text
117+ // Switch to a specific non-default theme
118+ await setTheme ( page , 'github-dark' ) ;
126119 const block = getBlock ( editor ) ;
127120 await expect ( block ) . toContainText ( 'const' ) ;
128121 const blockHtml = await block . innerHTML ( ) ;
0 commit comments