@@ -2749,4 +2749,55 @@ describe("Highlight Editor", () => {
27492749 ) ;
27502750 } ) ;
27512751 } ) ;
2752+
2753+ describe ( "Highlight color in HCM" , ( ) => {
2754+ let pages ;
2755+
2756+ beforeEach ( async ( ) => {
2757+ pages = await loadAndWait (
2758+ "tracemonkey.pdf" ,
2759+ ".annotationEditorLayer" ,
2760+ null ,
2761+ null ,
2762+ {
2763+ highlightEditorColors : "red=#AB0000,red_HCM=#00AB00" ,
2764+ forcePageColors : true ,
2765+ pageColorsForeground : "#74ffd0" ,
2766+ pageColorsBackground : "#392a4f" ,
2767+ }
2768+ ) ;
2769+ } ) ;
2770+
2771+ afterEach ( async ( ) => {
2772+ await closePages ( pages ) ;
2773+ } ) ;
2774+
2775+ it ( "must highlight with red color" , async ( ) => {
2776+ await Promise . all (
2777+ pages . map ( async ( [ browserName , page ] ) => {
2778+ await switchToHighlight ( page ) ;
2779+
2780+ const rect = await getSpanRectFromText ( page , 1 , "Abstract" ) ;
2781+ const x = rect . x + rect . width / 2 ;
2782+ const y = rect . y + rect . height / 2 ;
2783+ await page . mouse . click ( x , y , { count : 2 , delay : 100 } ) ;
2784+
2785+ const editorSelector = getEditorSelector ( 0 ) ;
2786+ await page . waitForSelector ( editorSelector ) ;
2787+ await page . waitForSelector (
2788+ `.page[data-page-number = "1"] svg.highlightOutline.selected`
2789+ ) ;
2790+
2791+ await page . waitForSelector (
2792+ `.page[data-page-number = "1"] .canvasWrapper > svg.highlight[fill = "#00AB00"]`
2793+ ) ;
2794+ await waitForSerialized ( page , 1 ) ;
2795+ const serialized = await getSerialized ( page ) ;
2796+ expect ( serialized [ 0 ] . color )
2797+ . withContext ( `In ${ browserName } ` )
2798+ . toEqual ( [ 0xab , 0x00 , 0x00 ] ) ;
2799+ } )
2800+ ) ;
2801+ } ) ;
2802+ } ) ;
27522803} ) ;
0 commit comments