Skip to content

Commit

Permalink
fix to fetch correct histogram for groups with multiple values for a …
Browse files Browse the repository at this point in the history
…field
  • Loading branch information
walterra committed Dec 20, 2022
1 parent 0f18284 commit 4e3055a
Showing 1 changed file with 4 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,13 @@
* 2.0.
*/

import { getGroupFilter } from './get_group_filter';
import { finalChangePointGroups } from '../../../common/__mocks__/artificial_logs/final_change_point_groups';

const changePointGroups = [
{
id: '2038579476',
group: [
{ fieldName: 'response_code', fieldValue: '500', duplicate: false },
{ fieldName: 'url', fieldValue: 'home.php', duplicate: false },
{ fieldName: 'url', fieldValue: 'login.php', duplicate: false },
],
docCount: 792,
pValue: 0.010770456205312423,
},
{
id: '817080373',
group: [{ fieldName: 'user', fieldValue: 'Peter', duplicate: false }],
docCount: 1981,
pValue: 2.7454255728359757e-21,
},
];
import { getGroupFilter } from './get_group_filter';

describe('getGroupFilter', () => {
it('gets a query filter for the change points of a group with multiple values per field', () => {
expect(getGroupFilter(changePointGroups[0])).toStrictEqual([
expect(getGroupFilter(finalChangePointGroups[0])).toStrictEqual([
{
term: {
response_code: '500',
Expand All @@ -43,7 +26,7 @@ describe('getGroupFilter', () => {
});

it('gets a query filter for the change points of a group with just a single field/value', () => {
expect(getGroupFilter(changePointGroups[1])).toStrictEqual([
expect(getGroupFilter(finalChangePointGroups[1])).toStrictEqual([
{
term: {
user: 'Peter',
Expand Down

0 comments on commit 4e3055a

Please sign in to comment.