Feat: add integration test for the stakeholder#1774
Feat: add integration test for the stakeholder#1774GuningShen wants to merge 4 commits intoGreenstand:v2from
Conversation
| method: 'get', | ||
| path: '/query/v2/stakeholder/1', | ||
| statusCode: 200, | ||
| body: stakeholder, |
There was a problem hiding this comment.
The organization mock json is deprecated, please create a new fixture (under fixture folder) json file for stakeholder , the spec of stakeholder is defined in our query api doc here:
https://github.com/Greenstand/treetracker-query-api/blob/fa194cb4a274ee688c2b26b58596147368d08b9e/docs/api/spec/query-api.yaml#L1542-L1559
|
@GuningShen your pull request looks pretty good, I added some comment:
|
|
Hi, @dadiorchen thanks for commenting. I am quite confused looking at the stakeholder schema. It seems the new version does not contain fields like created_at, org_name, etc and I cannot figure out how to render the organization page without mocking those variables. |
|
@GuningShen sorry for the inconvenience, the final definition of stakeholder is here: The yaml file is out of date, so please mock the stakeholder based on this db structure. |
|
Aslo it would be great if you can raise a pr to update our yaml file in query API. |
I just submitted a pr in query API! Please check that out. Thanks. |
yunchipang
left a comment
There was a problem hiding this comment.
overall lgtm! organization & stakeholder integration tests passed.
feel free to merge it after resolving the conflicts 🚀
There was a problem hiding this comment.
nit: I'd rename this fixture to be planter.json (I assume he's a planter)
| cy.task('nockIntercept', { | ||
| hostname: 'https://dev-k8s.treetracker.org', | ||
| method: 'get', | ||
| path: '/query/v2/stakeholder/1', |
There was a problem hiding this comment.
nit: I would use
path: `/query/v2/stakeholder/${stakeholder.id}`,
instead of
path: '/query/v2/stakeholder/1',
to populate the stakeholder id in path dynamically. And this should apply to all other paths in this test file if you are modifying any of them.
There was a problem hiding this comment.
Hi @yunchipang , thanks for your suggestion! I've just changed it. I agree it will make my code look cleaner.
|
@GuningShen sorry for the late review, could solve these conflict? we want to merge your pr |
Hi @dadiorchen , I just resolved all the merge conflicts. Could you check whether my code looks good to you? |

Description
comment: # I mock some data following the new v2/stakeholder/[stakeholderid] api for the cypress integration test.
Fixes #1769
Type of change
Screenshots
How Has This Been Tested?
Checklist: