codeburn/app/renderer/components/CliErrorPanel.test.tsx
Resham Joshi a0e66e3fcd
fix: desktop not-found panel gives app advice, not npm (#1701)
For a bundled CLI the not-found panel now tells desktop users to reopen or reinstall the app instead of installing from npm. Strings in all six locales.
2026-10-09 12:31:19 +02:00

24 lines
1.1 KiB
TypeScript

// @vitest-environment jsdom
import { render } from '@testing-library/react'
import { describe, expect, it } from 'vitest'
import { CliErrorPanel } from './CliErrorPanel'
describe('CliErrorPanel not-found', () => {
it('gives app advice, not npm, when the bundled engine is unreachable', () => {
const { container } = render(<CliErrorPanel error={{ kind: 'not-found', message: 'x', stage: 'bundled-missing' }} />)
expect(container.textContent).toContain('reinstall the app from codeburn.app')
expect(container.textContent).not.toContain('npm')
})
it('tells the user to allow CodeBurn when access was denied', () => {
const { container } = render(<CliErrorPanel error={{ kind: 'not-found', message: 'x', stage: 'bundled-denied' }} />)
expect(container.textContent).toContain('Security software')
expect(container.textContent).not.toContain('npm')
})
it('keeps the npm advice when no bundled CLI is configured', () => {
const { container } = render(<CliErrorPanel error={{ kind: 'not-found', message: 'x', stage: 'no-path-match' }} />)
expect(container.textContent).toContain('npm i -g codeburn')
})
})