@@ -29,6 +29,16 @@ async function getRevealCodeInlineFontSize(page: any): Promise<number> {
2929 return await getCSSProperty ( page . locator ( 'body' ) , "--r-inline-code-font-size" , true ) as number ;
3030}
3131
32+ async function checkColor ( element , cssProperty , rgbColors ) {
33+ await expect ( element ) . toHaveCSS ( cssProperty , `rgb(${ rgbColors . red } , ${ rgbColors . green } , ${ rgbColors . blue } )` ) ;
34+ }
35+
36+ function asRGB ( red , green , blue ) {
37+ return { red, green, blue } ;
38+ }
39+
40+
41+
3242test ( 'Code font size in callouts and smaller slide is scaled down' , async ( { page } ) => {
3343 await page . goto ( './revealjs/code-font-size.html' ) ;
3444 await page . locator ( 'body' ) . press ( 'ArrowRight' ) ;
@@ -116,4 +126,13 @@ test('Code font size is correctly set', async ({ page }) => {
116126 expect (
117127 await getCSSProperty ( page . locator ( "#non-highligted pre code" ) , 'font-size' , true )
118128 ) . toBeCloseTo ( codeBlockFontSize ) ;
129+ } ) ;
130+
131+ test ( 'Callouts colors can be customized' , async ( { page } ) => {
132+ await page . goto ( './revealjs/callouts/custom-colors.html' ) ;
133+ await checkColor ( page . locator ( 'div.callout-note' ) , 'border-left-color' , asRGB ( 128 , 0 , 128 ) ) ;
134+ await checkColor ( page . locator ( 'div.callout-tip' ) , 'border-left-color' , asRGB ( 255 , 255 , 0 ) ) ;
135+ await checkColor ( page . locator ( 'div.callout-warning' ) , 'border-left-color' , asRGB ( 173 , 216 , 230 ) ) ;
136+ await checkColor ( page . locator ( 'div.callout-important' ) , 'border-left-color' , asRGB ( 128 , 128 , 128 ) ) ;
137+ await checkColor ( page . locator ( 'div.callout-caution' ) , 'border-left-color' , asRGB ( 0 , 128 , 0 ) ) ;
119138} ) ;
0 commit comments