Skip to content

Commit

Permalink
Updated the API integration tests to check for new default fields and…
Browse files Browse the repository at this point in the history
… 15 buckets
  • Loading branch information
ogupte committed Feb 16, 2021
1 parent cd3407e commit 7eae6b9
Showing 1 changed file with 27 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,35 +55,41 @@ export default function ApiTest({ getService }: FtrProviderContext) {
it('returns significant terms', () => {
const sorted = response.body?.significantTerms?.sort();
expectSnapshot(sorted?.map((term) => term.fieldName)).toMatchInline(`
Array [
"user_agent.name",
"url.domain",
"host.ip",
"service.node.name",
"container.id",
"url.domain",
"user_agent.name",
]
`);
Array [
"user_agent.name",
"url.domain",
"host.ip",
"service.node.name",
"container.id",
"url.domain",
"host.ip",
"service.node.name",
"container.id",
"user_agent.name",
]
`);
});

it('returns a distribution per term', () => {
expectSnapshot(response.body?.significantTerms?.map((term) => term.distribution.length))
.toMatchInline(`
Array [
11,
11,
11,
11,
11,
11,
11,
]
`);
Array [
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
]
`);
});

it('returns overall distribution', () => {
expectSnapshot(response.body?.overall?.distribution.length).toMatchInline(`11`);
expectSnapshot(response.body?.overall?.distribution.length).toMatchInline(`15`);
});
});
}

0 comments on commit 7eae6b9

Please sign in to comment.