test: Add unit tests for basic layer operations in dispatcher#3937
test: Add unit tests for basic layer operations in dispatcher#3937yuvraj-kolkar17 wants to merge 3 commits intoGraphiteEditor:masterfrom
Conversation
Signed-off-by: Yuvraj Kolkar <kolkaryuvraj2@gmail.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request adds basic unit tests to Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
1 issue found across 1 file
Confidence score: 4/5
- This PR appears technically safe to merge, with the only reported concern being PR title format enforcement rather than a code behavior defect.
- The flagged issue is high-confidence but process-oriented: the title should be updated to the required sentence-case imperative format (for example, starting with “Add”) and avoid a conventional commit prefix.
- Because the finding does not indicate a runtime regression in
editor/src/dispatcher.rs, merge risk is low once repository conventions are satisfied. - Pay close attention to
editor/src/dispatcher.rs- ensure the PR metadata/title policy is corrected so checks and review workflow are not blocked.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="editor/src/dispatcher.rs">
<violation number="1" location="editor/src/dispatcher.rs:531">
P1: Custom agent: **PR title enforcement**
Update the PR title to follow the required format (no conventional commit prefix, sentence case, imperative verb like "Add").</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
Code Review
The pull request adds tests for creating a new document, drawing a rectangle, deleting a selected layer, and pasting layers. The reviewer suggested using DocumentMessage::DeleteSelectedLayers instead of NodeGraphMessage::DeleteSelectedNodes in the delete_selected_layer_reduces_count test for robustness and suggested avoiding the test-only PortfolioMessage::PasteIntoFolder API in the paste_twice_gives_five_layers test.
|
PTAL @TrueDoctor @Keavon |
What this pr does
Adds basic unit tests to
editor/src/dispatcher.rsfor simple layeroperations that had no test coverage before
Part of #3936
After 4 new test added

new_document_starts_emptyverifies a new document starts with zero layersdraw_rect_adds_one_layerverifies drawing a rectangle creates exactly one layerdelete_selected_layer_reduces_countverifies deleting the selected layer reduces the count from 3 to 2paste_twice_gives_five_layersverifies pasting the same clipboard content twice on 3 layers gives 5 total