Skip to content

Commit

Permalink
fix jest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Mar 30, 2023
1 parent 67ba5b3 commit 19449fa
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ describe('getShouldClauses', () => {
expect(shouldClauses).toEqual([
{
terms: {
response_code: ['500'],
user: ['Peter'],
},
},
{
terms: {
url: ['home.php', 'login.php'],
response_code: ['500'],
},
},
{
terms: {
user: ['Peter'],
url: ['home.php', 'login.php'],
},
},
]);
Expand All @@ -38,6 +38,10 @@ describe('getFrequentItemSetsAggFields', () => {
const frequentItemSetsAggFields = getFrequentItemSetsAggFields(significantTerms);

expect(frequentItemSetsAggFields).toEqual([
{
field: 'user',
include: ['Peter'],
},
{
field: 'response_code',
include: ['500'],
Expand All @@ -46,10 +50,6 @@ describe('getFrequentItemSetsAggFields', () => {
field: 'url',
include: ['home.php', 'login.php'],
},
{
field: 'user',
include: ['Peter'],
},
]);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,27 @@ describe('getMissingSignificantTerms', () => {
);

expect(missingSignificantTerms).toEqual([
{
bg_count: 632,
doc_count: 1738,
fieldName: 'url',
fieldValue: 'login.php',
normalizedScore: 0.10333028878375965,
pValue: 0.010770456205312423,
score: 4.53094842981472,
total_bg_count: 1975,
total_doc_count: 4671,
},
{
bg_count: 553,
doc_count: 1981,
fieldName: 'user',
fieldValue: 'Peter',
normalizedScore: 0.8327337555873047,
pValue: 2.7454255728359757e-21,
score: 47.34435085428873,
normalizedScore: 0.8328439168064725,
pValue: 2.62555579103777e-21,
score: 47.38899434932384,
total_bg_count: 1975,
total_doc_count: 4669,
},
{
bg_count: 632,
doc_count: 1738,
fieldName: 'url',
fieldValue: 'login.php',
normalizedScore: 0.07472703283204607,
pValue: 0.012783309213417932,
score: 4.359614926663956,
total_bg_count: 1975,
total_doc_count: 4671,
total_doc_count: 4669,
},
]);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ describe('getMissingSignificantTerms', () => {
);

expect(transformed).toEqual({
docCount: 1738,
docCount: 1981,
group: [
{
docCount: 1981,
duplicate: 1,
fieldName: 'url',
fieldValue: 'login.php',
docCount: 1738,
pValue: 0.010770456205312423,
fieldName: 'user',
fieldValue: 'Peter',
pValue: 2.62555579103777e-21,
},
],
id: '368426784',
pValue: 0.010770456205312423,
id: '817080373',
pValue: 2.62555579103777e-21,
});
});
});

0 comments on commit 19449fa

Please sign in to comment.