mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 08:02:28 +00:00
Fix delete workspace confirmation spacing (#6304)
This commit is contained in:
@@ -115,6 +115,10 @@ function buttonText(props: Record<string, unknown>): string {
|
||||
return renderToStaticMarkup(<>{props.children as ReactNode}</>)
|
||||
}
|
||||
|
||||
function visibleMarkupText(markup: string): string {
|
||||
return markup.replace(/<[^>]*>/g, '')
|
||||
}
|
||||
|
||||
describe('DeleteWorktreeDialog lineage copy', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
@@ -212,6 +216,20 @@ describe('DeleteWorktreeDialog lineage copy', () => {
|
||||
expect(markup).not.toContain('including uncommitted or untracked files')
|
||||
})
|
||||
|
||||
it('keeps a space between remove copy and the workspace name', async () => {
|
||||
const workspace = makeWorktree('Hide working dot', '/workspaces/hide-working-dot')
|
||||
mocks.state.modalData = { worktreeId: workspace.id }
|
||||
mocks.state.allWorktrees.mockReturnValue([workspace])
|
||||
|
||||
const { default: DeleteWorktreeDialog } = await import('./DeleteWorktreeDialog')
|
||||
const markup = renderToStaticMarkup(<DeleteWorktreeDialog />)
|
||||
|
||||
expect(visibleMarkupText(markup)).toContain(
|
||||
'Remove Hide working dot from git and delete its workspace folder.'
|
||||
)
|
||||
expect(markup).not.toContain('RemoveHide working dot')
|
||||
})
|
||||
|
||||
it('shows an inline warning when the workspace has uncommitted or untracked changes', async () => {
|
||||
const workspace = makeWorktree('Feature workspace', '/workspaces/feature')
|
||||
mocks.state.modalData = { worktreeId: workspace.id }
|
||||
|
||||
@@ -16,7 +16,7 @@ export function DeleteWorktreeDialogDescription({
|
||||
}): React.JSX.Element {
|
||||
return (
|
||||
<DialogDescription className="text-xs">
|
||||
{translate('auto.components.sidebar.DeleteWorktreeDialog.91492c9ad6', 'Remove')}
|
||||
{translate('auto.components.sidebar.DeleteWorktreeDialog.91492c9ad6', 'Remove')}{' '}
|
||||
<span className={targetClassName}>{targetLabel}</span>
|
||||
{canDeleteAllLineage ? (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user