The strapi instance used on the get eCash page was migrated to v4.
This comes with some data structure changes to the endpoint that need to be adjusted for
Mainly all of the values are nested in an attributes object now, image structure, and there is a top level data object
Also updated the scores tests and made them easier to understand by removing the verbose mocks and instead opting
for a easy to understand mock within the test file
Details
- Reviewers
bytesofman - Group Reviewers
Restricted Project - Commits
- rABC449dbe5ff499: [e.cash] Update strapi scorecard data
preview the site and check /get-ecash page. Should look the same
npm run test to run the tests
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- ecash-update-strapi
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 27139 Build 53844: Build Diff Build 53843: arc lint + arc unit
Event Timeline
web/e.cash/.env | ||
---|---|---|
3 | is this also STRAPI as the name implies? | |
web/e.cash/data/__tests__/scores.test.js | ||
10 | This is no longer used anywhere in the app -- but it is not deleted instead a variable of the same name with (presumably) a different structure is initialized in this test file. So, two changes here. 1 - We stop using imported mocks and instead define them in the test file (could be reasons to do this) Difficult to review as I can't see in this diff how the mock has changed shape. Please refactor so that the newly defined mocks simply overwrite the old ones in place. Then this diff will allow reviewer to see how the shape has changed. If, afterwards, it seems like a good idea to keep the mocks in this file -- we can move it over. But it looks like the new mocks were defined in the test file while making the tests work, then the old mocks were never overwritten. | |
11–23 | same point for the other mocks no longer imported. If they are no longer used, delete from mocks file. If they have changed shape, then the shape change should take place in the mocks file. |
web/e.cash/.env | ||
---|---|---|
3 | yes its strapi too. Should I update them to STRAPI_SCORECARD_URL and STRAPI_BLOG_URL or something? |
web/e.cash/data/__tests__/scores.test.js | ||
---|---|---|
10 | exchangeScoringCriteria actually still is used in scores.js. Its what sets the scores. Was previously imported here to use to test the scoring function, but I opted to define a mock scoring criteria that is easier to digest in the test file |
@bot preview-e.cash
web/e.cash/.env | ||
---|---|---|
3 | lol no it's fine -- just checking to see if the name was copypasta from the one above. |
Build Bitcoin ABC Diffs / Diff Testing (preview-e.cash) passed.
Preview is available at http://51.83.220.60:41579 for the next 60 minutes.