Skip to content

Commit

Permalink
Do not send ignore_throttled when search:includeFrozen is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasolson committed Sep 21, 2021
1 parent 119c742 commit 148b05b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 } : {};
}

/**
Expand Down

0 comments on commit 148b05b

Please sign in to comment.