-
Notifications
You must be signed in to change notification settings - Fork 765
e2e: Test that dragging to start commit #12177
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new E2E test to verify that users can drag files to a branch card (branch header) to start a new commit. Additionally, it refactors test utility functions by moving file staging/unstaging operations from commit.ts to file.ts, and simplifies the test setup in commitActions.spec.ts by using a script instead of manual UI navigation.
Changes:
- Added new E2E test for dragging files to start commits
- Moved
stageFirstFileandunstageAllFilesfromcommit.tstofile.tsfor better organization - Added new file assertion utilities (
assertFileIsStaged,assertFileIsUnstaged,assertFileIsUncommitted,assertNoUncommittedChanges) - Simplified test setup in
commitActions.spec.tsby replacing manual branch navigation withapply-upstream-branch.shscript
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
e2e/playwright/tests/dragToCommit.spec.ts |
New test file that verifies dragging a file to the branch card starts a commit with only that file staged |
e2e/playwright/src/file.ts |
Added new file assertion utilities and moved staging/unstaging functions from commit.ts for better organization |
e2e/playwright/src/commit.ts |
Removed stageFirstFile and unstageAllFiles functions (moved to file.ts) |
e2e/playwright/tests/commitActions.spec.ts |
Updated imports and simplified test setup by using script instead of manual UI navigation |
| hasText: 'branch1' | ||
| }); | ||
|
|
||
| // Drag the new file onto the top commit, to amend it |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is misleading. The test is dragging a file to the branch card to start a new commit, not to amend the top commit. The comment should say something like "Drag the new file onto the branch card to start a commit".
| // Drag the new file onto the top commit, to amend it | |
| // Drag the new file onto the branch card to start a commit |
| // Drag the new file onto the top commit, to amend it | ||
| await dragAndDropByLocator(page, fileLocator, branchCardLocator); | ||
|
|
||
| // Verify that the only the dragged file is now staged |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a grammatical error in this comment. It should read "Verify that only the dragged file is now staged" instead of "Verify that the only the dragged file is now staged".
| // Verify that the only the dragged file is now staged | |
| // Verify that only the dragged file is now staged |
| // (it's basically a no-op, just makes sure that the same commits after rebasing are on the remote) | ||
| await clickByTestId(page, 'stack-push-button'); | ||
|
|
||
| // Add a two new files to the workdir |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a grammatical error in this comment. It should read "Add two new files" instead of "Add a two new files".
| // Add a two new files to the workdir | |
| // Add two new files to the workdir |
167c163 to
75532c8
Compare
f6af85f to
e9fd5c8
Compare
Test the ability to drag a file into the branch header in order to start a commit.
e9fd5c8 to
3c659d6
Compare
Test the ability to drag a file into the branch header in order to start
a commit.
This is part 2 of 2 in a stack made with GitButler: