Fix/explorer#222
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request expands non-production CORS allowances to support additional local development ports/headers, and refreshes many Chakram integration tests by updating request IDs and query parameters to newer sample values.
Changes:
- Expanded non-production CORS
allowedOriginsto includelocalhost/127.0.0.1:3305. - Added
X-Requested-Withto the CORSallowedHeaderslist. - Updated numerous test requests (IDs and querystring parameters) across v2.0 and v1.5 endpoint tests.
Reviewed changes
Copilot reviewed 35 out of 37 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| app.js | Updates CORS origins/headers for local development. |
| test/v2.0-data-taxa-test.js | Updates taxa query parameters used by the test. |
| test/v2.0-data-speleothems-{collectionunitid}-test.js | Updates speleothem collectionunitid used in the test. |
| test/v2.0-data-spatial-lakes-test.js | Updates spatial lakes query parameters (site/buffer). |
| test/v2.0-data-spatial-icesheet-test.js | Updates age parameter for icesheet overlay test. |
| test/v2.0-data-spatial-faunal-test.js | Updates sciname parameter used by faunal overlay test. |
| test/v2.0-data-sites-test.js | Updates sites query parameters (includes DOI value). |
| test/v2.0-data-sites-{siteid}-datasets-test.js | Updates siteid used for datasets-by-site test. |
| test/v2.0-data-sites-{siteid}-chronologies-test.js | Updates siteid used for chronologies-by-site test. |
| test/v2.0-data-publications-test.js | Updates publications query parameters used by the test. |
| test/v2.0-data-publications-{publicationid}-test.js | Updates publicationid used by publication-by-id test. |
| test/v2.0-data-pollen-test.js | Updates pollen query parameters used by the test. |
| test/v2.0-data-pollen-{id}-test.js | Updates pollen record id used by the test. |
| test/v2.0-data-occurrences-test.js | Updates occurrences query parameters used by the test. |
| test/v2.0-data-geopoliticalunits-test.js | Updates geopolitical unit query parameters (rank/lower). |
| test/v2.0-data-geopoliticalunits-{gpid}-test.js | Updates gpid used by geopoliticalunit-by-id test. |
| test/v2.0-data-geopoliticalunits-{gpid}-sites-test.js | Updates gpid used by geopoliticalunit sites test. |
| test/v2.0-data-geopoliticalunits-{gpid}-datasets-test.js | Updates gpid used by geopoliticalunit datasets test. |
| test/v2.0-data-dbtables-test.js | Updates table query parameter used by dbtables test. |
| test/v2.0-data-dbtables-{table}-test.js | Updates {table} path param and toggles count query. |
| test/v2.0-data-datasets-test.js | Updates datasets query parameters (includes DOI value). |
| test/v2.0-data-datasets_elc-test.js | Updates datasets_elc query parameters used by the test. |
| test/v2.0-data-contacts-test.js | Updates contacts query parameters used by the test. |
| test/v2.0-data-contacts-{contactid}-test.js | Updates contactid used by contact-by-id test. |
| test/v2.0-data-contacts-{contactid}-sites-test.js | Updates contactid used by contact sites test. |
| test/v2.0-data-chronologies-{chronid}-test.js | Updates chronid used by chronology-by-id test. |
| test/v2.0-data-aggregatedatasets-{aggdatasetid}-test.js | Updates aggregate dataset id used by the test. |
| test/v2.0-apps-taphonomysystems-test.js | Updates datasettypeid used by the test. |
| test/v2.0-apps-depenvt-test.js | Updates site/dataset/collectionunit IDs used by the test. |
| test/v2.0-apps-constdb-datasetuploads-test.js | Updates constituent DB id used by the test. |
| test/v2.0-apps-constdb-datasets-test.js | Updates constituent DB id used by the test. |
| test/v2.0-apps-constdb-datasetages-test.js | Updates constituent DB id used by the test. |
| test/v1.5-data-geopoliticalunits-test.js | Updates geopolitical units query parameters in v1.5 test. |
| test/v1.5-data-geopoliticalunits-{gpid}-test.js | Updates gpid used by v1.5 geopoliticalunit-by-id test. |
| test/v1.5-data-contacts-{contactid}-test.js | Updates v1.5 contact id used by the test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| it('should respond 200 for "An array of sites."', function() { | ||
| var response = request('get', 'http://localhost:3001/v2.0/data/sites', { | ||
| 'qs': {"sitename":"sunt","database":"Canadian Museum of Nature-Delorme Ostracoda-Surface Samples","datasettype":"specimen stable isotope","altmin": 10,"altmax": 100,"loc":"{\"type\":\"Polygon\",\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}},\"coordinates\":[[[13.4,55.92],[13.5,55.92],[13.5,55.95],[13.4,55.95],[13.4,55.92]]]}","siteid":42988,"datasetid":60309948,"doi":"1021436435/Q7","gpid":5392,"keyword":"beyond radiocarbon","contactid":13502,"taxa":"minim","ageyoung": 1000,"ageold": 10000,"ageof":4640795,"limit": 10,"offset": 0}, | ||
| 'qs': {"sitename":"nostrud velit dolore in in","database":"Diatom Paleolimnology Data Cooperative (DPDC)","datasettype":"modern biochemistry","altmin": 10,"altmax": 100,"loc":"{\"type\":\"Polygon\",\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}},\"coordinates\":[[[13.4,55.92],[13.5,55.92],[13.5,55.95],[13.4,55.95],[13.4,55.92]]]}","siteid":2022,"datasetid":67760076,"doi":"10)73259/W8;78U83/","gpid":5392,"keyword":"bottom","contactid":20094,"taxa":"adipisicing nostrud exercitation","ageyoung": 1000,"ageold": 10000,"ageof":19655794,"limit": 10,"offset": 0}, |
| it('should respond 200 for "An array of datasets."', function() { | ||
| var response = request('get', 'http://localhost:3001/v2.0/data/datasets', { | ||
| 'qs': {"sitename":"ut cillum consectetur","database":"St. Croix Watershed Research Station of the Science Museum of Minnesota","datasettype":"macroinvertebrate","altmin": 10,"altmax": 100,"loc":"{\"type\":\"Polygon\",\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}},\"coordinates\":[[[13.4,55.92],[13.5,55.92],[13.5,55.95],[13.4,55.95],[13.4,55.92]]]}","siteid":31891,"datasetid":23595575,"doi":"10B18997295/TZX21W4","gpid":5392,"keyword":"modern","contactid":20234,"taxa":"exercitation amet irure Excepteur","ageyoung": 1000,"ageold": 10000,"ageof":7003042,"limit": 10,"offset": 0}, | ||
| 'qs': {"sitename":"Excepteur sint anim sed do","database":"Canadian Pollen Database","datasettype":"charcoal surface sample","altmin": 10,"altmax": 100,"loc":"{\"type\":\"Polygon\",\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}},\"coordinates\":[[[13.4,55.92],[13.5,55.92],[13.5,55.95],[13.4,55.95],[13.4,55.92]]]}","siteid":45345,"datasetid":12116711,"doi":"10d91690/6YEIVB","gpid":5392,"keyword":"modern","contactid":14536,"taxa":"dolore elit","ageyoung": 1000,"ageold": 10000,"ageof":13721899,"limit": 10,"offset": 0}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates CORS configuration to support additional local development ports and allowed headers, and makes several changes to test files by updating request parameters and IDs to reflect new or more relevant test data. These changes help improve local development flexibility and ensure the tests are using up-to-date or more appropriate sample data.
CORS Configuration Updates:
http://localhost:3305andhttp://127.0.0.1:3305to the list of allowed origins for non-production environments inapp.js.'X-Requested-With'in the list of allowed CORS headers inapp.js.