Skip to content

Commit

Permalink
Updated tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
adcoelho committed Jul 19, 2024
1 parent b294d7c commit c2742d8
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,16 @@ describe('enable()', () => {
expect(taskManager.bulkEnable).not.toHaveBeenCalled();
});

test('throws an error if API params do not match the schema', async () => {
await expect(
// @ts-ignore: this is what we are testing
async () => await rulesClient.enable({ id: 1 })
).rejects.toThrowErrorMatchingInlineSnapshot(
`"Error validating enable rule parameters - [id]: expected value of type [string] but got [number]"`
);
expect(taskManager.bulkEnable).not.toHaveBeenCalled();
});

test('falls back when failing to getDecryptedAsInternalUser', async () => {
encryptedSavedObjects.getDecryptedAsInternalUser.mockRejectedValue(new Error('Fail'));

Expand Down

0 comments on commit c2742d8

Please sign in to comment.