fix: address code review feedback

- Replace type assertions with type guards in types.ts (isDateString, isStringArray)
- Add useCallback for event handlers (handleTaskClick, handleKeyDown)
- Replace styled-jsx with CSS modules (gantt.module.css)
- Update tests to use CSS module class name patterns
This commit is contained in:
Jason Woltje
2026-01-29 19:32:23 -06:00
parent aa6d466321
commit 16697bfb79
4 changed files with 63 additions and 39 deletions

View File

@@ -91,7 +91,7 @@ describe("GanttChart", () => {
render(<GanttChart tasks={tasks} />);
const taskRow = screen.getAllByText("Completed Task")[0].closest("[role='row']");
expect(taskRow).toHaveClass(/completed/i);
expect(taskRow?.className).toMatch(/Completed/i);
});
it("should visually distinguish in-progress tasks", () => {
@@ -106,7 +106,7 @@ describe("GanttChart", () => {
render(<GanttChart tasks={tasks} />);
const taskRow = screen.getAllByText("Active Task")[0].closest("[role='row']");
expect(taskRow).toHaveClass(/in-progress/i);
expect(taskRow?.className).toMatch(/InProgress/i);
});
});