[data.search] Do not send ignore_throttled when search:includeFrozen is disabled (#112755)
* Do not send ignore_throttled when search:includeFrozen is disabled * Fix tests
This commit is contained in:
parent
1b93b00212
commit
791fed5b82
|
@ -132,7 +132,6 @@ describe('EQL search strategy', () => {
|
|||
expect(request).toEqual(
|
||||
expect.objectContaining({
|
||||
ignore_unavailable: true,
|
||||
ignore_throttled: true,
|
||||
})
|
||||
);
|
||||
});
|
||||
|
|
|
@ -31,12 +31,12 @@ const getMockSearchSessionsConfig = ({
|
|||
|
||||
describe('request utils', () => {
|
||||
describe('getIgnoreThrottled', () => {
|
||||
test('returns `ignore_throttled` as `true` when `includeFrozen` is `false`', async () => {
|
||||
test('does not return `ignore_throttled` when `includeFrozen` is `false`', async () => {
|
||||
const mockUiSettingsClient = getMockUiSettingsClient({
|
||||
[UI_SETTINGS.SEARCH_INCLUDE_FROZEN]: false,
|
||||
});
|
||||
const result = await getIgnoreThrottled(mockUiSettingsClient);
|
||||
expect(result.ignore_throttled).toBe(true);
|
||||
expect(result).not.toHaveProperty('ignore_throttled');
|
||||
});
|
||||
|
||||
test('returns `ignore_throttled` as `false` when `includeFrozen` is `true`', async () => {
|
||||
|
|
|
@ -23,7 +23,7 @@ export async function getIgnoreThrottled(
|
|||
uiSettingsClient: IUiSettingsClient
|
||||
): Promise<Pick<Search, 'ignore_throttled'>> {
|
||||
const includeFrozen = await uiSettingsClient.get(UI_SETTINGS.SEARCH_INCLUDE_FROZEN);
|
||||
return { ignore_throttled: !includeFrozen };
|
||||
return includeFrozen ? { ignore_throttled: false } : {};
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue