mirror of
https://github.com/stablyai/orca.git
synced 2026-10-01 08:01:56 +00:00
fix(dev): preserve forced secret protection report
This commit is contained in:
@@ -94,6 +94,20 @@ describe('scheduleSecretProtectionGapReport', () => {
|
||||
expect(logged).toEqual([])
|
||||
})
|
||||
|
||||
it('honors forced reports for development profiles', () => {
|
||||
scheduleSecretProtectionGapReport({
|
||||
dataFile,
|
||||
log: (m) => void logged.push(m),
|
||||
deferUntilFirstWindow: true,
|
||||
skipInDevelopment: true,
|
||||
force: true
|
||||
})
|
||||
createWindow().reveal()
|
||||
drain()
|
||||
expect(probes).toBe(1)
|
||||
expect(logged).toEqual(['[secrets] The OS keyring is unavailable.'])
|
||||
})
|
||||
|
||||
/** Runs an already-queued setImmediate; the 1ms is slack, not a delay under test. */
|
||||
const drain = (): void => void vi.advanceTimersByTime(1)
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ export function scheduleSecretProtectionGapReport({
|
||||
/** Development profiles are disposable/isolated and must not trigger OS keychain UI. */
|
||||
skipInDevelopment?: boolean
|
||||
}): void {
|
||||
if (skipInDevelopment) {
|
||||
if (skipInDevelopment && !options.force) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user