sync: update from private repo (f6d625db)
CI / build-and-test (push) Has been cancelled

This commit is contained in:
oss-sync
2026-06-26 03:35:45 +00:00
parent 29ccaf1e92
commit b857c33ef6
371 changed files with 31312 additions and 8172 deletions
@@ -0,0 +1,22 @@
/**
* Pure-function tests for shouldConfirmWrite.
* No DOM render needed — these run in node env.
*/
import { describe, it, expect } from 'vitest';
import { shouldConfirmWrite } from './app-bridge';
describe('shouldConfirmWrite', () => {
it('returns false when autoApprove=true (always bypass confirm)', () => {
// Even a path that would normally require confirm is bypassed.
expect(shouldConfirmWrite('my-app', 'some/arbitrary/file.txt', true)).toBe(false);
});
it('returns false when path is under output/ (allowlisted, no confirm needed)', () => {
expect(shouldConfirmWrite('my-app', 'output/report.csv', false)).toBe(false);
});
it('returns true when autoApprove=false and path is NOT allowlisted', () => {
// A path not under output/ or apps/{appName}/data/ must trigger a confirm.
expect(shouldConfirmWrite('my-app', 'some/arbitrary/file.txt', false)).toBe(true);
});
});