refactor: remove width prop from Card component and add as const to test array.

This commit is contained in:
Mark McLaughlin
2026-02-05 11:07:19 -08:00
parent 254bdbc027
commit 5dfcab609a
2 changed files with 3 additions and 9 deletions
@@ -17,6 +17,7 @@ describe('Card', () => {
suffix: '0.26.0 → 0.27.0', suffix: '0.26.0 → 0.27.0',
prefix: true, prefix: true,
body: 'Installed via Homebrew. Please update with "brew upgrade gemini-cli".', body: 'Installed via Homebrew. Please update with "brew upgrade gemini-cli".',
width: 40,
}, },
{ {
variant: 'information', variant: 'information',
@@ -46,17 +47,11 @@ describe('Card', () => {
prefix: true, prefix: true,
body: 'Listed 39 item(s).', body: 'Listed 39 item(s).',
}, },
])( ] as const)(
'renders a $variant card with prefix=$prefix', 'renders a $variant card with prefix=$prefix',
({ variant, title, suffix, prefix, body }) => { ({ variant, title, suffix, prefix, body }) => {
const { lastFrame } = render( const { lastFrame } = render(
<Card <Card variant={variant} title={title} suffix={suffix} prefix={prefix}>
variant={variant}
title={title}
suffix={suffix}
prefix={prefix}
width={80}
>
<Text>{body}</Text> <Text>{body}</Text>
</Card>, </Card>,
); );
@@ -23,7 +23,6 @@ export interface CardProps {
children?: React.ReactNode; children?: React.ReactNode;
/** The styling and intent of the card. */ /** The styling and intent of the card. */
variant?: 'information' | 'success' | 'warning' | 'error' | 'confirmation'; variant?: 'information' | 'success' | 'warning' | 'error' | 'confirmation';
width?: number | string;
} }
const CardDisplay: React.FC<CardProps> = ({ const CardDisplay: React.FC<CardProps> = ({