mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-21 21:15:56 +08:00
* feat(self-host): add capability-aware setup * fix(self-host): preserve capability compatibility * fix(copilot): honor preview availability server-side * improvement(self-host): centralize capability resolution * fix(self-host): preserve integration availability paths * fix(testing): align capability-aware config mocks * improvement(self-host): simplify capability setup configuration * fix(setup): preserve unowned storage overrides * fix(self-host): reconcile storage and allowlists * fix(integrations): preserve connect deep links
25 lines
1.0 KiB
TypeScript
25 lines
1.0 KiB
TypeScript
import { describe, expect, it } from 'bun:test'
|
|
import type { SetupFieldPrompt } from './capability-config.ts'
|
|
import { formatCapabilitySetupFieldMessage, markCurrentlyUsed } from './capability-setup.ts'
|
|
|
|
describe('capability setup presentation', () => {
|
|
it('marks the effective option as currently used without replacing its hint', () => {
|
|
expect(markCurrentlyUsed('paste an API key', true)).toBe('paste an API key · Currently used')
|
|
expect(markCurrentlyUsed(undefined, true)).toBe('Currently used')
|
|
expect(markCurrentlyUsed('paste an API key', false)).toBe('paste an API key')
|
|
})
|
|
|
|
it('marks existing fields and explains how secrets are preserved', () => {
|
|
const prompt: SetupFieldPrompt = {
|
|
type: 'field',
|
|
key: 'RESEND_API_KEY',
|
|
input: 'secret',
|
|
}
|
|
|
|
expect(formatCapabilitySetupFieldMessage(prompt, true, true)).toBe(
|
|
'RESEND_API_KEY (Currently used); leave empty to keep it'
|
|
)
|
|
expect(formatCapabilitySetupFieldMessage(prompt, false, true)).toBe('RESEND_API_KEY')
|
|
})
|
|
})
|