Skip to content

Commit

Permalink
chore: added more tests for vaultOps.deleteSecret
Browse files Browse the repository at this point in the history
  • Loading branch information
aryanjassal committed Sep 10, 2024
1 parent 0c9a476 commit a389880
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/vaults/VaultOps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit a389880

Please sign in to comment.