diff options
| author | Jacob Richman <[email protected]> | 2025-08-15 20:18:31 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-16 03:18:31 +0000 |
| commit | 6c1373c33212e26521701acf73c0398721b3a881 (patch) | |
| tree | 6a00fb90c90b51a0c8285b21af7b174064ab6492 /packages/cli/src/ui/components/Header.test.tsx | |
| parent | d57cc0b9306f0359482ef6e243308bcda2989007 (diff) | |
Revert "Update semantic color tokens" (#6365)
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, 7 insertions, 9 deletions
diff --git a/packages/cli/src/ui/components/Header.test.tsx b/packages/cli/src/ui/components/Header.test.tsx index a1b694a6..95ed3f07 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 } from 'vitest'; +import { describe, it, expect, vi, beforeEach } from 'vitest'; import { Header } from './Header.js'; import * as useTerminalSize from '../hooks/useTerminalSize.js'; import { longAsciiLogo } from './AsciiArt.js'; @@ -13,13 +13,15 @@ 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()?.trim()).toContain(longAsciiLogo.trim()); + expect(lastFrame()).toContain(longAsciiLogo); }); it('renders custom ASCII art when provided', () => { @@ -27,20 +29,16 @@ describe('<Header />', () => { const { lastFrame } = render( <Header version="1.0.0" nightly={false} customAsciiArt={customArt} />, ); - expect(lastFrame()?.trim()).toContain(customArt); + expect(lastFrame()).toContain(customArt); }); it('displays the version number when nightly is true', () => { const { lastFrame } = render(<Header version="1.0.0" nightly={true} />); - expect(lastFrame()?.trim()).toContain('v1.0.0'); + expect(lastFrame()).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()?.trim()).not.toContain('v1.0.0'); + expect(lastFrame()).not.toContain('v1.0.0'); }); }); |
