mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 09:32:41 +00:00
Resolve "Transition to ESLint"
This commit is contained in:
committed by
Rainer Killinger
parent
ca1d2444e0
commit
418ba67d15
@@ -20,23 +20,23 @@ import {AggregationResponse} from '../../../src/storage/elasticsearch/types/elas
|
||||
|
||||
describe('Aggregations', function () {
|
||||
const aggregations: AggregationResponse = {
|
||||
catalog: {
|
||||
doc_count: 4,
|
||||
'catalog': {
|
||||
'doc_count': 4,
|
||||
'superCatalogs.categories': {
|
||||
buckets: []
|
||||
buckets: [],
|
||||
},
|
||||
'academicTerm.acronym': {
|
||||
buckets: [
|
||||
{
|
||||
key: 'SoSe 2020',
|
||||
doc_count: 2
|
||||
}
|
||||
]
|
||||
doc_count: 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
'superCatalog.categories': {
|
||||
buckets: []
|
||||
buckets: [],
|
||||
},
|
||||
categories: {
|
||||
'categories': {
|
||||
buckets: [
|
||||
{
|
||||
key: 'foo',
|
||||
@@ -46,21 +46,21 @@ describe('Aggregations', function () {
|
||||
key: 'bar',
|
||||
doc_count: 3,
|
||||
},
|
||||
]
|
||||
}
|
||||
],
|
||||
},
|
||||
},
|
||||
person: {
|
||||
doc_count: 13,
|
||||
'person': {
|
||||
'doc_count': 13,
|
||||
'homeLocations.categories': {
|
||||
buckets: []
|
||||
}
|
||||
buckets: [],
|
||||
},
|
||||
},
|
||||
'academic event': {
|
||||
doc_count: 0,
|
||||
'doc_count': 0,
|
||||
'academicTerms.acronym': {
|
||||
buckets: []
|
||||
buckets: [],
|
||||
},
|
||||
categories: {
|
||||
'categories': {
|
||||
buckets: [
|
||||
{
|
||||
key: 'foobar',
|
||||
@@ -70,18 +70,18 @@ describe('Aggregations', function () {
|
||||
key: 'bar',
|
||||
doc_count: 2,
|
||||
},
|
||||
]
|
||||
],
|
||||
},
|
||||
'creativeWorks.keywords': {
|
||||
buckets: []
|
||||
}
|
||||
buckets: [],
|
||||
},
|
||||
},
|
||||
fooType: {
|
||||
'fooType': {
|
||||
buckets: [
|
||||
{
|
||||
doc_count: 321,
|
||||
key: 'foo'
|
||||
}
|
||||
key: 'foo',
|
||||
},
|
||||
],
|
||||
},
|
||||
'@all': {
|
||||
@@ -90,71 +90,71 @@ describe('Aggregations', function () {
|
||||
buckets: [
|
||||
{
|
||||
key: 'person',
|
||||
doc_count: 13
|
||||
doc_count: 13,
|
||||
},
|
||||
{
|
||||
key: 'catalog',
|
||||
doc_count: 4
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
doc_count: 4,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const expectedFacets: SCFacet[] = [
|
||||
{
|
||||
buckets: [
|
||||
{
|
||||
count: 13,
|
||||
'key': 'person'
|
||||
},
|
||||
{
|
||||
count: 4,
|
||||
key: 'catalog'
|
||||
}
|
||||
],
|
||||
field: 'type',
|
||||
},
|
||||
{
|
||||
buckets: [
|
||||
{
|
||||
count: 8,
|
||||
key: 'foobar'
|
||||
},
|
||||
{
|
||||
count: 2,
|
||||
key: 'bar'
|
||||
}
|
||||
],
|
||||
field: 'categories',
|
||||
onlyOnType: SCThingType.AcademicEvent,
|
||||
},
|
||||
{
|
||||
buckets: [
|
||||
{
|
||||
count: 2,
|
||||
key: 'SoSe 2020'
|
||||
}
|
||||
],
|
||||
field: 'academicTerm.acronym',
|
||||
onlyOnType: SCThingType.Catalog
|
||||
},
|
||||
{
|
||||
buckets: [
|
||||
{
|
||||
count: 1,
|
||||
key: 'foo'
|
||||
},
|
||||
{
|
||||
count: 3,
|
||||
key: 'bar'
|
||||
}
|
||||
],
|
||||
field: 'categories',
|
||||
onlyOnType: SCThingType.Catalog,
|
||||
},
|
||||
// no fooType as it doesn't appear in the aggregation schema
|
||||
];
|
||||
{
|
||||
buckets: [
|
||||
{
|
||||
count: 13,
|
||||
key: 'person',
|
||||
},
|
||||
{
|
||||
count: 4,
|
||||
key: 'catalog',
|
||||
},
|
||||
],
|
||||
field: 'type',
|
||||
},
|
||||
{
|
||||
buckets: [
|
||||
{
|
||||
count: 8,
|
||||
key: 'foobar',
|
||||
},
|
||||
{
|
||||
count: 2,
|
||||
key: 'bar',
|
||||
},
|
||||
],
|
||||
field: 'categories',
|
||||
onlyOnType: SCThingType.AcademicEvent,
|
||||
},
|
||||
{
|
||||
buckets: [
|
||||
{
|
||||
count: 2,
|
||||
key: 'SoSe 2020',
|
||||
},
|
||||
],
|
||||
field: 'academicTerm.acronym',
|
||||
onlyOnType: SCThingType.Catalog,
|
||||
},
|
||||
{
|
||||
buckets: [
|
||||
{
|
||||
count: 1,
|
||||
key: 'foo',
|
||||
},
|
||||
{
|
||||
count: 3,
|
||||
key: 'bar',
|
||||
},
|
||||
],
|
||||
field: 'categories',
|
||||
onlyOnType: SCThingType.Catalog,
|
||||
},
|
||||
// no fooType as it doesn't appear in the aggregation schema
|
||||
];
|
||||
|
||||
it('should parse the aggregations providing the appropriate facets', function () {
|
||||
const facets = parseAggregations(aggregations);
|
||||
|
||||
Reference in New Issue
Block a user