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