diff --git a/src/renderer/src/components/right-sidebar/source-control-branch-context-row.test.tsx b/src/renderer/src/components/right-sidebar/source-control-branch-context-row.test.tsx new file mode 100644 index 000000000..c9eb2fad9 --- /dev/null +++ b/src/renderer/src/components/right-sidebar/source-control-branch-context-row.test.tsx @@ -0,0 +1,40 @@ +import { renderToStaticMarkup } from 'react-dom/server' +import type { ReactNode } from 'react' +import { describe, expect, it, vi } from 'vitest' +import { SourceControlBranchContextRow } from './source-control-branch-context-row' +import type { GitBranchCompareSummary } from '../../../../shared/types' + +vi.mock('@/components/ui/tooltip', () => ({ + Tooltip: ({ children }: { children: ReactNode }) => <>{children}, + TooltipContent: ({ children }: { children: ReactNode }) => <>{children}, + TooltipTrigger: ({ children }: { children: ReactNode }) => <>{children} +})) + +const readySummary: GitBranchCompareSummary = { + baseRef: 'refs/remotes/origin/FRONT-192-ZisVoucherStrip', + baseOid: 'base', + compareRef: 'feature', + headOid: 'head', + mergeBase: 'base', + changedFiles: 0, + commitsAhead: 0, + status: 'ready' +} + +describe('SourceControlBranchContextRow', () => { + it('lets the base ref use the full available header width', () => { + const markup = renderToStaticMarkup( + + ) + + expect(markup).toContain('refs/remotes/origin/FRONT-192-ZisVoucherStrip') + expect(markup).toContain('max-w-full') + expect(markup).toContain('min-w-0 flex-1') + expect(markup).not.toContain('max-w-[9rem]') + }) +}) diff --git a/src/renderer/src/components/right-sidebar/source-control-branch-context-row.tsx b/src/renderer/src/components/right-sidebar/source-control-branch-context-row.tsx index e2c51b1d8..27d1183d5 100644 --- a/src/renderer/src/components/right-sidebar/source-control-branch-context-row.tsx +++ b/src/renderer/src/components/right-sidebar/source-control-branch-context-row.tsx @@ -25,7 +25,7 @@ function BaseRefButton({ return (