Fix audit log tests (#111706)

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.
This commit is contained in:
Thomas Watson 2021-09-09 15:01:07 +02:00 committed by GitHub
parent b001830d58
commit 29142a6fb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();