Skip to content

Commit 524fa68

Browse files
js-jankisalvidevamanv
authored andcommitted
[ResponseOps][MaintenanceWindows] Fix mw internal client by passing hidden SO type (elastic#248132)
## Summary Internal MW client using internal repository was introduced in elastic#247390. It created problems while fetching MWs using all spaces in synthetics plugin. This PR fixes the issue. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.
1 parent 6d45f26 commit 524fa68

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

x-pack/platform/plugins/shared/maintenance_windows/server/maintenance_window_client_factory.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,16 @@ test('creates an internal maintenance window client', async () => {
107107
const factory = new MaintenanceWindowClientFactory();
108108
factory.initialize(maintenanceWindowClientFactoryParams);
109109
const request = mockRouter.createKibanaRequest();
110-
const mockRepository = savedObjectsService.createInternalRepository();
110+
const mockRepository = savedObjectsService.createInternalRepository([
111+
MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE,
112+
]);
111113
savedObjectsService.createInternalRepository.mockReturnValue(mockRepository);
112114

113115
factory.createInternal(request);
114116

115-
expect(savedObjectsService.createInternalRepository).toHaveBeenCalledWith();
117+
expect(savedObjectsService.createInternalRepository).toHaveBeenCalledWith([
118+
MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE,
119+
]);
116120

117121
const { MaintenanceWindowClient } = jest.requireMock('./client');
118122

0 commit comments

Comments
 (0)