-
-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: add integration test for the stakeholder #1774
base: v2
Are you sure you want to change the base?
Conversation
method: 'get', | ||
path: '/query/v2/stakeholder/1', | ||
statusCode: 200, | ||
body: stakeholder, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall lgtm! organization
& stakeholder
integration tests passed.
feel free to merge it after resolving the conflicts 🚀
cypress/fixtures/940.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: