Skip to content

Commit 3962f7f

Browse files
Merge branch 'main' into SC-5164/delivery-inegration-test
2 parents 9a24e19 + 5fa8ca3 commit 3962f7f

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

.github/workflows/test-and-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
id-token: write
2727
contents: read
2828
runs-on: ubuntu-latest
29-
needs: integration-test
29+
needs: test
3030
# Only run if it's one of our three deployment branches
3131
if: contains(fromJSON('["qa", "qa2", "production"]'), github.ref_name)
3232
steps:

lib/elasticsearch/config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ const AGGREGATIONS_SPEC = {
125125
buildingLocation: { terms: { field: 'buildingLocationIds' } },
126126
subjectLiteral: { terms: { field: 'subjectLiteral.raw' } },
127127
language: { terms: { field: 'language_packed' } },
128-
contributorLiteral: { terms: { field: 'contributorLiteral.raw' } },
129-
creatorLiteral: { terms: { field: 'creatorLiteral.raw' } },
130128
collection: { terms: { field: 'collectionIds' } }
131129
}
132130

test/resources.test.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ describe('Resources query', function () {
250250
q: 'toast',
251251
filters: {
252252
subjectLiteral: ['S1'],
253-
contributorLiteral: ['C1', 'C2']
253+
collection: ['C1', 'C2']
254254
}
255255
})
256256
const queries = resourcesPrivMethods.aggregationQueriesForParams(params)
@@ -260,27 +260,27 @@ describe('Resources query', function () {
260260
expect(Object.keys(queries[0].aggregations)).to.have.lengthOf(numAggregations - 2)
261261
expect(queries[0].query.bool.filter).to.be.a('array')
262262
// Expect the subjectLiteral filter:
263-
expect(queries[0].query.bool.filter[0].term['subjectLiteral.raw'] === 'S1')
264-
// .. And the contributorLiteral filters:
265-
expect(queries[0]).to.nested.include({ 'query.bool.filter[1].bool.should[0].bool.should[0].term.contributorLiteral\\.keywordLowercased': 'C1' })
266-
expect(queries[0]).to.nested.include({ 'query.bool.filter[1].bool.should[1].bool.should[0].term.contributorLiteral\\.keywordLowercased': 'C2' })
263+
expect(queries[0].query.bool.filter[1].term['subjectLiteral.raw'] === 'S1')
264+
// .. And the collection filters:
265+
expect(queries[0]).to.nested.include({ 'query.bool.filter[0].bool.should[0].term.collectionIds': 'C1' })
266+
expect(queries[0]).to.nested.include({ 'query.bool.filter[0].bool.should[1].term.collectionIds': 'C2' })
267267

268-
// Expect second aggregation for subjectLiteral:
268+
// Expect second aggregation for collection:
269269
expect(Object.keys(queries[1].aggregations)).to.have.lengthOf(1)
270-
expect(queries[1]).to.nested.include({ 'aggregations.subjectLiteral.terms.field': 'subjectLiteral.raw' })
271-
// Expect this agg to filter on the other active filter, contributorLiteral:
272-
expect(queries[1]).to.nested.include({ 'query.bool.filter[0].bool.should[0].bool.should[0].term.contributorLiteral\\.keywordLowercased': 'C1' })
273-
expect(queries[1]).to.nested.include({ 'query.bool.filter[0].bool.should[1].bool.should[0].term.contributorLiteral\\.keywordLowercased': 'C2' })
270+
expect(queries[1]).to.nested.include({ 'aggregations.collection.terms.field': 'collectionIds' })
271+
// Expect this agg to filter on the other active filter, subjectLiteral:
274272
expect(queries[1].query.bool.filter).to.have.lengthOf(1)
275-
expect(queries[1].query.bool.filter[0].bool.should).to.have.lengthOf(2)
276273

277-
// Expect last aggregation for contributorLiteral:
274+
expect(queries[1].query.bool.filter[0].term['subjectLiteral.raw'] === 'S1')
275+
276+
// Expect last aggregation for subjectLiteral:
278277
expect(Object.keys(queries[2].aggregations)).to.have.lengthOf(1)
279-
expect(queries[2]).to.nested.include({ 'aggregations.contributorLiteral.terms.field': 'contributorLiteral.raw' })
280-
// Expect this agg to filter on the other active filter, subjectLiteral:
278+
expect(queries[2]).to.nested.include({ 'aggregations.subjectLiteral.terms.field': 'subjectLiteral.raw' })
279+
// Expect this agg to filter on the other active filter, collection:
280+
expect(queries[2]).to.nested.include({ 'query.bool.filter[0].bool.should[0].term.collectionIds': 'C1' })
281+
expect(queries[2]).to.nested.include({ 'query.bool.filter[0].bool.should[1].term.collectionIds': 'C2' })
281282
expect(queries[2].query.bool.filter).to.have.lengthOf(1)
282-
283-
expect(queries[2].query.bool.filter[0].term['subjectLiteral.raw'] === 'S1')
283+
expect(queries[2].query.bool.filter[0].bool.should).to.have.lengthOf(2)
284284
})
285285
})
286286

0 commit comments

Comments
 (0)