mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-10-29 18:44:34 +00:00
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.
24 lines
1.1 KiB
TypeScript
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')
|
|
})
|
|
})
|