@@ -3,7 +3,6 @@ import { type ReactNode, useRef, useState } from "react";
33import { expect , it , vi } from "vite-plus/test" ;
44import { page , userEvent } from "vite-plus/test/browser" ;
55
6- import "../../index.css" ;
76import { render } from "../../../test/render" ;
87import { ComposerHandleContext , type ComposerHandleRef } from "../../composerHandleContext" ;
98import { Menu , MenuPopup , MenuRadioGroup , MenuRadioItem , MenuTrigger } from "../ui/menu" ;
@@ -88,26 +87,6 @@ it("marks the current mode as checked and closes on Escape", async () => {
8887 await expect . element ( screen . getByRole ( "button" , { name : "Effort" } ) ) . toHaveFocus ( ) ;
8988} ) ;
9089
91- it ( "keeps the space between permission options clickable" , async ( ) => {
92- await using screen = await render ( < EffortMenu /> , { router : false } ) ;
93- await userEvent . click ( screen . getByRole ( "button" , { name : "Effort" } ) ) ;
94- const items = options . map ( ( option ) =>
95- page . getByRole ( "menuitemradio" , { name : option . label } ) . element ( ) ,
96- ) ;
97-
98- for ( let i = 0 ; i < items . length - 1 ; i ++ ) {
99- const left = items [ i ] ! ;
100- const right = items [ i + 1 ] ! ;
101- const leftRect = left . getBoundingClientRect ( ) ;
102- const rightRect = right . getBoundingClientRect ( ) ;
103- expect ( rightRect . left - leftRect . right ) . toBeLessThanOrEqual ( 0 ) ;
104- for ( const y of [ leftRect . top + 1 , leftRect . top + leftRect . height / 2 ] ) {
105- expect ( left . contains ( document . elementFromPoint ( leftRect . right - 1.5 , y ) ) ) . toBe ( true ) ;
106- expect ( right . contains ( document . elementFromPoint ( rightRect . left + 1.5 , y ) ) ) . toBe ( true ) ;
107- }
108- }
109- } ) ;
110-
11190// The real composer menu focus rule (useComposerMenuProps), with a stub composer handle.
11291function withComposer ( children : ReactNode ) {
11392 const handle = { focusAtEnd : vi . fn ( ) } ;
0 commit comments