Skip to content

Conversation

@estib-vega
Copy link
Contributor

@estib-vega estib-vega commented Feb 3, 2026

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:

Copilot AI review requested due to automatic review settings February 3, 2026 13:54
@vercel
Copy link

vercel bot commented Feb 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
gitbutler-web Skipped Skipped Feb 3, 2026 6:19pm

Request Review

Copy link
Contributor

Copilot AI left a 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 stageFirstFile and unstageAllFiles from commit.ts to file.ts for better organization
  • Added new file assertion utilities (assertFileIsStaged, assertFileIsUnstaged, assertFileIsUncommitted, assertNoUncommittedChanges)
  • Simplified test setup in commitActions.spec.ts by replacing manual branch navigation with apply-upstream-branch.sh script

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
Copy link

Copilot AI Feb 3, 2026

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".

Suggested change
// Drag the new file onto the top commit, to amend it
// Drag the new file onto the branch card to start a commit

Copilot uses AI. Check for mistakes.
// 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
Copy link

Copilot AI Feb 3, 2026

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".

Suggested change
// Verify that the only the dragged file is now staged
// Verify that only the dragged file is now staged

Copilot uses AI. Check for mistakes.
// (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
Copy link

Copilot AI Feb 3, 2026

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".

Suggested change
// Add a two new files to the workdir
// Add two new files to the workdir

Copilot uses AI. Check for mistakes.
Base automatically changed from drop-to-stage to master February 3, 2026 18:17
Test the ability to drag a file into the branch header in order to start
a commit.
@estib-vega estib-vega enabled auto-merge February 3, 2026 18:19
@estib-vega estib-vega merged commit 213aa1c into master Feb 3, 2026
25 checks passed
@estib-vega estib-vega deleted the e2e-drop-to-stage branch February 3, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants