Improve test coverage for Elasticsearch
A recent change to Elastic queries caused search to stop working on the beta site:
- Issue: #143 (closed)
- MR that introduced the problem: !228 (merged)
- Revert: !238 (merged)
Let's figure out how to add test coverage to prevent that from occurring again. We should be more thorough with manual testing, but an automated test could help, too.
A good test should:
- Actually connect to Elastic and verify it can run a few different queries and get a non-error result.
- Check out check-elastic-key-permissions.cjs as an example of connecting to Elastic from a node script
- Run the same query method as our production-facing code
Probably makes sense to write this as a Jest test.
Edited by Sarah German