@@ -407,13 +407,35 @@ describe('build-css astryx.css', () => {
407407 ) ;
408408 expect ( paints . length ) . toBeGreaterThanOrEqual ( 10 ) ;
409409 // Not the hover strength: under a finger there is no hover to land on,
410- // and a paint that stepped there would still have to step off.
410+ // and a paint that stepped there would still have to step off. Only a
411+ // hovering pointer's own hover paints beneath the fading image: on the
412+ // `fading` arm, in a `:hover` rule under `(hover: hover)`.
411413 const arms = lines ( ) . filter ( line =>
412414 / \[ d a t a - a s t r y x - p r e s s = " (?: o n | f a d i n g ) " \] / . test ( line ) ,
413415 ) ;
414- expect ( arms . some ( line => line . includes ( '--color-overlay-hover' ) ) ) . toBe (
415- false ,
416+ const hoverArms = arms . filter ( line =>
417+ line . includes ( '--color-overlay-hover' ) ,
416418 ) ;
419+ expect ( hoverArms . length ) . toBeGreaterThan ( 0 ) ;
420+ for ( const line of hoverArms ) {
421+ expect ( line ) . toContain ( '[data-astryx-press="fading"]' ) ;
422+ expect ( line ) . toContain ( ':hover' ) ;
423+ expect ( line ) . toMatch ( / \( h o v e r : ? h o v e r \) / ) ;
424+ expect ( line ) . not . toContain ( '[data-astryx-press="on"]' ) ;
425+ }
426+ // A coarse pointer that can also hover still yields the release to the
427+ // button's compositor layer: its `none` arm is not narrowed to pointers
428+ // that cannot hover.
429+ const coarseYield = arms . filter (
430+ line =>
431+ line . includes ( '[data-astryx-press="fading"]' ) &&
432+ / b a c k g r o u n d - i m a g e : \s * n o n e / . test ( line ) &&
433+ / \( p o i n t e r : ? c o a r s e \) / . test ( line ) ,
434+ ) ;
435+ expect ( coarseYield . length ) . toBeGreaterThan ( 0 ) ;
436+ expect (
437+ coarseYield . filter ( line => / n o t \( h o v e r : ? h o v e r \) / . test ( line ) ) ,
438+ ) . toEqual ( [ ] ) ;
417439 } ) ;
418440 } ) ;
419441 describe ( 'the press releases under reduced motion (design:reduced-motion)' , ( ) => {
0 commit comments