Skip to content

Commit

Permalink
Fix test failure
Browse files Browse the repository at this point in the history
Signed-off-by: gaobinlong <gbinlong@amazon.com>
  • Loading branch information
gaobinlong committed Feb 29, 2024
1 parent 04fcc8f commit 8b72ba1
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ type MockedOptions = OpenSearchDashboardsMigratorOptions & {
};

const mockOptions = (isPermissionControlEnabled?: boolean) => {
const rawConfig = configMock.create();
rawConfig.get.mockReturnValue(false);
if (isPermissionControlEnabled) {
rawConfig.get.mockReturnValue(true);
}
const options: MockedOptions = {
logger: loggingSystemMock.create().get(),
opensearchDashboardsVersion: '8.2.3',
Expand Down Expand Up @@ -193,11 +198,7 @@ const mockOptions = (isPermissionControlEnabled?: boolean) => {
skip: false,
},
client: opensearchClientMock.createOpenSearchClient(),
opensearchDashboardsRawConfig: rawConfig,
};
if (isPermissionControlEnabled) {
const rawConfig = configMock.create();
rawConfig.get.mockReturnValue(true);
options.opensearchDashboardsRawConfig = rawConfig;
}
return options;
};

0 comments on commit 8b72ba1

Please sign in to comment.