Skip to content

Commit

Permalink
[backend] fix counts
Browse files Browse the repository at this point in the history
  • Loading branch information
marieflorescontact committed Mar 25, 2024
1 parent f15ecd8 commit 5bd41be
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ describe('Elasticsearch computation', () => {
// noinspection JSUnresolvedVariable
const storedFormat = moment(R.head(data).date)._f;
expect(storedFormat).toEqual('YYYY-MM-DD');
expect(R.head(data).value).toEqual(35);
expect(R.head(data).value).toEqual(36);
});
it('should month histogram accurate', async () => {
const data = await elHistogramCount(
Expand Down Expand Up @@ -396,7 +396,7 @@ describe('Elasticsearch pagination', () => {
it('should entity paginate everything', async () => {
const data = await elPaginate(testContext, ADMIN_USER, READ_ENTITIES_INDICES, { first: ES_MAX_PAGINATION });
expect(data).not.toBeNull();
expect(data.edges.length).toEqual(506);
expect(data.edges.length).toEqual(508);
const filterBaseTypes = R.uniq(R.map((e) => e.node.base_type, data.edges));
expect(filterBaseTypes.length).toEqual(1);
expect(R.head(filterBaseTypes)).toEqual('ENTITY');
Expand Down Expand Up @@ -492,7 +492,7 @@ describe('Elasticsearch pagination', () => {
filterGroups: [],
};
const data = await elPaginate(testContext, ADMIN_USER, READ_ENTITIES_INDICES, { filters, first: ES_MAX_PAGINATION });
expect(data.edges.length).toEqual(495);
expect(data.edges.length).toEqual(497);
});
it('should entity paginate with field exist filter', async () => {
const filters = {
Expand Down Expand Up @@ -555,7 +555,7 @@ describe('Elasticsearch pagination', () => {
filterGroups: [],
};
data = await elPaginate(testContext, ADMIN_USER, READ_ENTITIES_INDICES, { filters, first: ES_MAX_PAGINATION });
expect(data.edges.length).toEqual(360);
expect(data.edges.length).toEqual(361);
filters = {
mode: 'and',
filters: [
Expand All @@ -573,7 +573,7 @@ describe('Elasticsearch pagination', () => {
orderMode: 'asc',
first: ES_MAX_PAGINATION
});
expect(data.edges.length).toEqual(506);
expect(data.edges.length).toEqual(508);
const createdDates = R.map((e) => e.node.created, data.edges);
let previousCreatedDate = null;
for (let index = 0; index < createdDates.length; index += 1) {
Expand Down Expand Up @@ -617,7 +617,7 @@ describe('Elasticsearch pagination', () => {
let data = await elPaginate(testContext, ADMIN_USER, READ_RELATIONSHIPS_INDICES, { includeAuthorities: true });
expect(data).not.toBeNull();
const groupByIndices = R.groupBy((e) => e.node._index, data.edges);
expect(groupByIndices[`${ES_INDEX_PREFIX}_internal_relationships-000001`].length).toEqual(47);
expect(groupByIndices[`${ES_INDEX_PREFIX}_internal_relationships-000001`].length).toEqual(50);
expect(groupByIndices[`${ES_INDEX_PREFIX}_stix_core_relationships-000001`].length).toEqual(24);
expect(groupByIndices[`${ES_INDEX_PREFIX}_stix_meta_relationships-000001`].length).toEqual(124);
expect(groupByIndices[`${ES_INDEX_PREFIX}_stix_sighting_relationships-000001`].length).toEqual(2);
Expand Down

0 comments on commit 5bd41be

Please sign in to comment.