@@ -67,6 +67,26 @@ describe('parseOutline', () => {
6767 const cs = getComputedStyle ( div )
6868 expect ( parseOutline ( cs ) ) . toEqual ( { top : 0 , right : 0 , bottom : 0 , left : 0 } )
6969 } )
70+
71+ it ( 'returns outline width for solid outline with no offset' , ( ) => {
72+ const cs = { outlineStyle : 'solid' , outlineWidth : '3px' , outlineOffset : '0px' }
73+ const res = parseOutline ( cs )
74+ expect ( res ) . toEqual ( { top : 3 , right : 3 , bottom : 3 , left : 3 } )
75+ } )
76+
77+ it ( 'adds positive outline-offset to bleed (NEW-3)' , ( ) => {
78+ const cs = { outlineStyle : 'solid' , outlineWidth : '2px' , outlineOffset : '4px' }
79+ const res = parseOutline ( cs )
80+ // total = ceil(2) + max(0, ceil(4)) = 2 + 4 = 6
81+ expect ( res ) . toEqual ( { top : 6 , right : 6 , bottom : 6 , left : 6 } )
82+ } )
83+
84+ it ( 'does not subtract for negative outline-offset (NEW-3)' , ( ) => {
85+ const cs = { outlineStyle : 'solid' , outlineWidth : '3px' , outlineOffset : '-2px' }
86+ const res = parseOutline ( cs )
87+ // negative offset never reduces bleed below outline width
88+ expect ( res ) . toEqual ( { top : 3 , right : 3 , bottom : 3 , left : 3 } )
89+ } )
7090} )
7191
7292describe ( 'parseFilterDropShadows' , ( ) => {
0 commit comments