mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 20:03:37 +00:00
fix: improve worktree branch handling in list route
- Updated the logic in the createListHandler to ensure that the branch name is correctly assigned, especially for the main worktree when it may be missing. - Added checks to handle cases where the worktree directory might not exist, ensuring that removed worktrees are accurately tracked. - Enhanced the final worktree entry handling to account for scenarios where the output does not end with a blank line, improving robustness.
This commit is contained in:
@@ -14,7 +14,6 @@ import {
|
||||
setupProjectWithPath,
|
||||
waitForBoardView,
|
||||
authenticateForTests,
|
||||
handleLoginScreenIfPresent,
|
||||
} from '../utils';
|
||||
|
||||
const TEST_TEMP_DIR = createTempDirPath('worktree-tests');
|
||||
@@ -55,10 +54,16 @@ test.describe('Worktree Integration', () => {
|
||||
await waitForNetworkIdle(page);
|
||||
await waitForBoardView(page);
|
||||
|
||||
// Wait for the worktree selector to appear (indicates API call completed)
|
||||
const branchLabel = page.getByText('Branch:');
|
||||
await expect(branchLabel).toBeVisible({ timeout: 10000 });
|
||||
|
||||
// Wait for the main branch button to appear
|
||||
// This ensures the worktree API has returned data with the main branch
|
||||
const mainBranchButton = page.locator('[data-testid="worktree-branch-main"]');
|
||||
await expect(mainBranchButton).toBeVisible({ timeout: 15000 });
|
||||
|
||||
// Verify the branch name is displayed
|
||||
await expect(mainBranchButton).toContainText('main');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user