Skip to content

Conversation

@ethanbalgobin
Copy link

@ethanbalgobin ethanbalgobin commented Nov 18, 2025

Description

This pull request adds end-to-end testing for the TODO list feature.
The test suite covers all core TODO functionality including:

  • Opening and closing the TODO list via UI, keyboard shortcuts (Shift+T+S, Shift+T+N), and command palette
  • Creating TODOs with various field combinations (title only, with description, with priority, all fields)
  • Creating multiple TODOs using the "Create More" checkbox
  • Updating TODO fields (title, description, priority) individually and in combination
  • Marking TODOs as complete/incomplete with visual feedback verification
  • Deleting TODOs in various states (open, completed)
  • Edge cases including disabled editing on completed TODOs and empty state display
  • The implementation follows the Page Object Model pattern with dedicated sections for the TODO list, create form, and edit form, along with helper functions and test data generators for maintainability and reusability.

Dependencies

  • List of the dependencies for this change, otherwise omit this section.

Screenshots

Screenshots if applicable, otherwise omit this section.

Testing instructions

  1. Ensure the development environment is running:

docker-compose up -d

  1. Run all TODO E2E tests:
cd web
npm run test:e2e -- --grep "@todo"
  1. Run specific test suites:
  # Test TODO creation
   npm run test:e2e -- todo-create-spec.ts
   
   # Test TODO updates
   npm run test:e2e -- todo-update.spec.ts
   
   # Test TODO completion
   npm run test:e2e -- todo-complete.spec.ts
   
   # Test TODO deletion
   npm run test:e2e -- todo-delete.spec.ts
   
   # Test TODO list open/close
   npm run test:e2e -- todo-open-close.spec.ts
  1. Verify all 19 tests pass successfully.

Checklist

@boring-cyborg
Copy link

boring-cyborg bot commented Nov 18, 2025

Thanks for opening this pull request! 🥳
Please check out our contributing guide.
If you have any questions, please ask in the #development channel in our
Slack or Discord.
Happy coding! 🚀

@vercel
Copy link

vercel bot commented Nov 18, 2025

@ethanbalgobin is attempting to deploy a commit to the Opcotech Team on Vercel.

A member of the Team first needs to authorize it.

Signed-off-by: Ethan Balgobin <[email protected]>
@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@gabor-boros gabor-boros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly have minor comments related to formatting and TodoPriority type usage. However, some e2e tests seems to fail (mostly due to duplicated element selector results).

export * from "./pages";
export * from "./permissions";
export * from "./toast";
export * from "./todo";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export * from "./todo";
export * from "./todo";

await page.getByPlaceholder(/Type a command/i).waitFor();
await page.getByRole("option", { name: /Add Todo/i }).click();
await page.getByRole("heading", { name: "Add Todo" }).waitFor();
} No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

}
await this.submit();
}
} No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

async fillTodoFields(fields: {
title?: string;
description?: string;
priority?: "normal" | "important" | "urgent" | "critical";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have a TodoPriority type in the generated client that we could use here.

async updateTodo(fields: {
title?: string;
description?: string;
priority?: "normal" | "important" | "urgent" | "critical";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the TodoPriority type exists, we could use that here too.

priority: "important",
dueDate: tomorrow,
};
} No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

// Check for reduced opacity on todo item
await expect(todoItem).toHaveClass(/opacity-75/);
});
}); No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
});
});

await waitForSuccessToast(page, "Todo added successfully");
expect(await todoSection.getTodoCount()).toBeGreaterThanOrEqual(2);
});
}); No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
});
});


expect(await todoSection.isOpen()).toBe(true);
});
}); No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
});
});

const editButton = todoItem.getByTitle("Edit todo");
expect(await editButton.isDisabled()).toBe(true);
});
}); No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
});
});

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gabor-boros Thanks for the feedback, will get these sorted!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E2e tests for the todo list

2 participants