Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions frontend/src/components/HomeComponents/Tasks/TaskDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ export const TaskDialog = ({
data-testid={`task-row-${task.id}`}
id={`task-row-${task.id}`}
key={index}
className={`border-b cursor-pointer ${
selectedIndex === index ? 'bg-muted/50' : ''
className={`border-b cursor-pointer hover:dark:bg-muted/50 hover:bg-black/15 ${
selectedIndex === index ? 'dark:bg-muted/50 bg-black/15' : ''
}`}
data-selected={selectedIndex === index}
onClick={() => {
onSelectTask(task, index);
}}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/HomeComponents/Tasks/Tasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export const Tasks = (
target instanceof HTMLTextAreaElement ||
target instanceof HTMLSelectElement ||
_isDialogOpen ||
isAddTaskOpen ||
target.isContentEditable
) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,19 +609,16 @@ describe('TaskDialog Component', () => {

describe('Selected State', () => {
test('should highlight selected task row', () => {
const { container } = render(
<TaskDialog {...defaultProps} selectedIndex={0} />
);
render(<TaskDialog {...defaultProps} selectedIndex={0} />);

const taskRow = container.querySelector('.bg-muted\\/50');
expect(taskRow).toBeInTheDocument();
const taskRow = screen.getByText(mockTask.description).closest('tr');
expect(taskRow).toHaveAttribute('data-selected', 'true');
});

test('should not highlight non-selected task row', () => {
render(<TaskDialog {...defaultProps} selectedIndex={1} />);

const taskRow = screen.getByText(mockTask.description).closest('tr');
expect(taskRow).not.toHaveClass('bg-muted/50');
expect(taskRow).toHaveAttribute('data-selected', 'false');
});
});

Expand Down
Loading