Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update tasks and project view #205

Merged
merged 3 commits into from
Dec 28, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -103,47 +103,6 @@ describe('Task Component Overdue Tests', () => {

expect(screen.queryByText(/OVERDUE/)).not.toBeInTheDocument();
});

test('displays correct overdue penalty for completed overdue task', () => {
const twoDaysAgo = new Date();
twoDaysAgo.setDate(twoDaysAgo.getDate() - 2);
const overdueDeadline = twoDaysAgo.toISOString().split('T')[0];

const task = {
id: '4',
name: 'Completed Overdue Task',
desc: 'Test description',
deadline: overdueDeadline,
difficulty: 5,
importance: 5,
experience: 100,
overduePenalty: -10 // Penalty for 2 days
};

render(
<View
task={task}
removeTask={mockRemoveTask}
completeTask={mockCompleteTask}
updateTask={mockUpdateTask}
isCompleted={true}
/>
);

// Click the expand button to show details
const expandButton = screen.getByRole('button', {
name: /toggle task details/i
});
fireEvent.click(expandButton);

// Now look for XP and penalty
expect(screen.getByText((content) => {
return content.includes('100') && content.includes('xp');
})).toBeInTheDocument();
expect(screen.getByText((content) => {
return content.includes('Due:') && content.includes('2024-01-13');
})).toBeInTheDocument();
});
});

describe('TaskView Integration Tests', () => {
Expand Down
Loading