Skip to content

Commit f23af79

Browse files
committed
fix mocks
1 parent ae0907f commit f23af79

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

x-pack/plugins/licensing/server/licensing.mocks.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66
import { BehaviorSubject } from 'rxjs';
7-
import { LicensingPluginSetup } from './types';
7+
import { LicensingPluginSetup, LicensingPluginStart } from './types';
88
import { licenseMock } from '../common/licensing.mock';
9+
import { featureUsageMock } from './services/feature_usage_service.mock';
910

1011
const createSetupMock = () => {
1112
const license = licenseMock.createLicense();
1213
const mock: jest.Mocked<LicensingPluginSetup> = {
1314
license$: new BehaviorSubject(license),
1415
refresh: jest.fn(),
1516
createLicensePoller: jest.fn(),
17+
featureUsage: featureUsageMock.createSetup(),
1618
};
1719
mock.refresh.mockResolvedValue(license);
1820
mock.createLicensePoller.mockReturnValue({
@@ -23,7 +25,16 @@ const createSetupMock = () => {
2325
return mock;
2426
};
2527

28+
const createStartMock = (): jest.Mocked<LicensingPluginStart> => {
29+
const mock = {
30+
featureUsage: featureUsageMock.createStart(),
31+
};
32+
33+
return mock;
34+
};
35+
2636
export const licensingMock = {
2737
createSetup: createSetupMock,
38+
createStart: createStartMock,
2839
createLicense: licenseMock.createLicense,
2940
};

0 commit comments

Comments
 (0)