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:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user