diff options
| author | Miguel Solorio <[email protected]> | 2025-08-15 15:39:54 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-15 22:39:54 +0000 |
| commit | 3c0af3654ac5491e79c6f9b55de5debf0e1e13c1 (patch) | |
| tree | 51eabe9544038b06b0c0a78d31dfa25232de3754 /packages/cli/src/ui/components/Header.test.tsx | |
| parent | 5246aa11f49108a22d4ba306a49b1af79153cac1 (diff) | |
Update semantic color tokens (#6253)
Co-authored-by: jacob314 <[email protected]>
Diffstat (limited to 'packages/cli/src/ui/components/Header.test.tsx')
| -rw-r--r-- | packages/cli/src/ui/components/Header.test.tsx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/packages/cli/src/ui/components/Header.test.tsx b/packages/cli/src/ui/components/Header.test.tsx index 95ed3f07..a1b694a6 100644 --- a/packages/cli/src/ui/components/Header.test.tsx +++ b/packages/cli/src/ui/components/Header.test.tsx @@ -5,7 +5,7 @@ */ import { render } from 'ink-testing-library'; -import { describe, it, expect, vi, beforeEach } from 'vitest'; +import { describe, it, expect, vi } from 'vitest'; import { Header } from './Header.js'; import * as useTerminalSize from '../hooks/useTerminalSize.js'; import { longAsciiLogo } from './AsciiArt.js'; @@ -13,15 +13,13 @@ import { longAsciiLogo } from './AsciiArt.js'; vi.mock('../hooks/useTerminalSize.js'); describe('<Header />', () => { - beforeEach(() => {}); - it('renders the long logo on a wide terminal', () => { vi.spyOn(useTerminalSize, 'useTerminalSize').mockReturnValue({ columns: 120, rows: 20, }); const { lastFrame } = render(<Header version="1.0.0" nightly={false} />); - expect(lastFrame()).toContain(longAsciiLogo); + expect(lastFrame()?.trim()).toContain(longAsciiLogo.trim()); }); it('renders custom ASCII art when provided', () => { @@ -29,16 +27,20 @@ describe('<Header />', () => { const { lastFrame } = render( <Header version="1.0.0" nightly={false} customAsciiArt={customArt} />, ); - expect(lastFrame()).toContain(customArt); + expect(lastFrame()?.trim()).toContain(customArt); }); it('displays the version number when nightly is true', () => { const { lastFrame } = render(<Header version="1.0.0" nightly={true} />); - expect(lastFrame()).toContain('v1.0.0'); + expect(lastFrame()?.trim()).toContain('v1.0.0'); }); it('does not display the version number when nightly is false', () => { + vi.spyOn(useTerminalSize, 'useTerminalSize').mockReturnValue({ + columns: 40, + rows: 20, + }); const { lastFrame } = render(<Header version="1.0.0" nightly={false} />); - expect(lastFrame()).not.toContain('v1.0.0'); + expect(lastFrame()?.trim()).not.toContain('v1.0.0'); }); }); |
