@@ -21,6 +21,8 @@ vi.mock('@/lib/internal/oci-secrets/operations', () => ({
2121import { OciClientError } from '@/lib/internal/oci/errors'
2222import { executeOciSecretsTool } from '@/lib/internal/oci-secrets/execute-tool'
2323import type { InternalToolOperationCall } from '@/lib/internal/tool-operations/types'
24+ import { OciSecretsBlock } from '@/blocks/blocks/oci_secrets'
25+ import { ociSecretsListSecretsTool } from '@/tools/oci_secrets/list_secrets'
2426
2527const client = { request : vi . fn ( ) }
2628const access = {
@@ -91,6 +93,35 @@ describe('executeOciSecretsTool', () => {
9193 } )
9294 } )
9395
96+ it . each ( [ null , '' , undefined , 'vault-1' ] ) (
97+ 'normalizes the optional native vault filter (%s)' ,
98+ async ( vaultId ) => {
99+ const raw = {
100+ operation : 'list_secrets' ,
101+ oauthCredential : 'selected-credential' ,
102+ compartmentId : 'compartment-1' ,
103+ vaultId,
104+ }
105+ const params = { ...raw , ...OciSecretsBlock . tools . config ?. params ?.( raw ) }
106+ const response = await executeOciSecretsTool (
107+ request ( {
108+ toolId : ociSecretsListSecretsTool . id ,
109+ input : ociSecretsListSecretsTool . operation . input ( params ) ,
110+ } )
111+ )
112+ expect ( response . status ) . toBe ( 200 )
113+ expect ( mocks . execute ) . toHaveBeenCalledWith (
114+ expect . anything ( ) ,
115+ expect . objectContaining ( {
116+ operation : 'list_secrets' ,
117+ vaultId : vaultId || undefined ,
118+ compartmentId : 'compartment-1' ,
119+ } ) ,
120+ undefined
121+ )
122+ }
123+ )
124+
94125 it . each ( operations ) (
95126 'dispatches %s using the registered ID and trusted authority' ,
96127 async ( operation ) => {
0 commit comments