fix(trust): Update config.isTrustedFolder (#7373)

This commit is contained in:
shrutip90
2025-08-28 19:41:33 -07:00
committed by GitHub
parent 9037f25df7
commit 2a0e69d833
11 changed files with 67 additions and 135 deletions

View File

@@ -143,24 +143,6 @@ describe('ToolConfirmationMessage', () => {
expect(lastFrame()).toContain(alwaysAllowText);
});
it('should show "allow always" when folder trust is undefined', () => {
const mockConfig = {
isTrustedFolder: () => undefined,
getIdeMode: () => false,
} as unknown as Config;
const { lastFrame } = renderWithProviders(
<ToolConfirmationMessage
confirmationDetails={details}
config={mockConfig}
availableTerminalHeight={30}
terminalWidth={80}
/>,
);
expect(lastFrame()).toContain(alwaysAllowText);
});
it('should NOT show "allow always" when folder is untrusted', () => {
const mockConfig = {
isTrustedFolder: () => false,

View File

@@ -56,7 +56,7 @@ export const ToolConfirmationMessage: React.FC<
onConfirm(outcome);
};
const isTrustedFolder = config.isTrustedFolder() !== false;
const isTrustedFolder = config.isTrustedFolder();
useKeypress(
(key) => {