File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed
frontend/src/components/HomeComponents/Tasks Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -91,9 +91,10 @@ export const TaskDialog = ({
9191 data-testid = { `task-row-${ task . id } ` }
9292 id = { `task-row-${ task . id } ` }
9393 key = { index }
94- className = { `border-b cursor-pointer ${
95- selectedIndex === index ? 'bg-muted/50' : ''
94+ className = { `border-b cursor-pointer hover:dark:bg-muted/50 hover:bg-black/15 ${
95+ selectedIndex === index ? 'dark: bg-muted/50 bg-black/15 ' : ''
9696 } `}
97+ data-selected = { selectedIndex === index }
9798 onClick = { ( ) => {
9899 onSelectTask ( task , index ) ;
99100 } }
Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ export const Tasks = (
151151 target instanceof HTMLTextAreaElement ||
152152 target instanceof HTMLSelectElement ||
153153 _isDialogOpen ||
154+ isAddTaskOpen ||
154155 target . isContentEditable
155156 ) {
156157 return ;
Original file line number Diff line number Diff line change @@ -609,19 +609,16 @@ describe('TaskDialog Component', () => {
609609
610610 describe ( 'Selected State' , ( ) => {
611611 test ( 'should highlight selected task row' , ( ) => {
612- const { container } = render (
613- < TaskDialog { ...defaultProps } selectedIndex = { 0 } />
614- ) ;
612+ render ( < TaskDialog { ...defaultProps } selectedIndex = { 0 } /> ) ;
615613
616- const taskRow = container . querySelector ( '.bg-muted\\/50 ') ;
617- expect ( taskRow ) . toBeInTheDocument ( ) ;
614+ const taskRow = screen . getByText ( mockTask . description ) . closest ( 'tr ') ;
615+ expect ( taskRow ) . toHaveAttribute ( 'data-selected' , 'true' ) ;
618616 } ) ;
619617
620618 test ( 'should not highlight non-selected task row' , ( ) => {
621619 render ( < TaskDialog { ...defaultProps } selectedIndex = { 1 } /> ) ;
622-
623620 const taskRow = screen . getByText ( mockTask . description ) . closest ( 'tr' ) ;
624- expect ( taskRow ) . not . toHaveClass ( 'bg-muted/50 ') ;
621+ expect ( taskRow ) . toHaveAttribute ( 'data-selected' , 'false ') ;
625622 } ) ;
626623 } ) ;
627624
You can’t perform that action at this time.
0 commit comments