Skip to content

Commit

Permalink
Fix audit log tests (#111706) (#111723)
Browse files Browse the repository at this point in the history
This ensures that the config object given to the `AuditService` setup
method is in fact the `xpack.security.audit.*` config options.
Previously the entire `xpack.security.*` config object would be passed
in.

The reason why this didn't fail the tests before was that both happen to
have a similarly named config option called `enabled`, which these tests
rely on.

Co-authored-by: Thomas Watson <w@tson.dk>
  • Loading branch information
kibanamachine and watson authored Sep 9, 2021
1 parent 37582f5 commit 014a4e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion x-pack/plugins/security/server/audit/audit_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
jest.useFakeTimers();

const createConfig = (settings: Partial<ConfigType['audit']>) => {
return ConfigSchema.validate(settings);
return ConfigSchema.validate({ audit: settings }).audit;
};

const logger = loggingSystemMock.createLogger();
Expand Down

0 comments on commit 014a4e4

Please sign in to comment.