diff --git a/tests/vaults/VaultOps.test.ts b/tests/vaults/VaultOps.test.ts index fe22ca4f5..8c1f5da32 100644 --- a/tests/vaults/VaultOps.test.ts +++ b/tests/vaults/VaultOps.test.ts @@ -298,6 +298,28 @@ describe('VaultOps', () => { vaultsErrors.ErrorSecretsSecretUndefined, ); }); + test('deleting multiple secrets', async () => { + const secretNames = ['secret1', 'secret2', 'secret3']; + for (const secretName of secretNames) { + await writeSecret(secretName, secretName); + } + await vaultOps.deleteSecret(vault, secretNames); + for (const secretName of secretNames) { + await expectSecretNot(secretName); + } + }); + test('deleting multiple secrets should add only one new log message', async () => { + const secretNames = ['secret1', 'secret2', 'secret3']; + for (const secretName of secretNames) { + await writeSecret(secretName, secretName); + } + const logLength = (await vault.log()).length; + await vaultOps.deleteSecret(vault, secretNames); + for (const secretName of secretNames) { + await expectSecretNot(secretName); + } + expect((await vault.log()).length).toBe(logLength + 1); + }); }); describe('mkdir', () => { test('can create directory', async () => {