treetracker-web-map-client icon indicating copy to clipboard operation
treetracker-web-map-client copied to clipboard

Feat: add integration test for the stakeholder

Open GuningShen opened this issue 1 year ago • 7 comments
trafficstars

Description

comment: # I mock some data following the new v2/stakeholder/[stakeholderid] api for the cypress integration test.

Fixes #1769

Type of change

  • [x] New feature (non-breaking change which adds functionality)

Screenshots

Before After
"screenshot before" Screenshot 2024-04-11 at 8 46 49 PM

How Has This Been Tested?

  • [x] Cypress integration

Checklist:

  • [x] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [x] Any dependent changes have been merged and published in downstream modules

GuningShen avatar Mar 28 '24 17:03 GuningShen

@GuningShen your pull request looks pretty good, I added some comment:

  1. The mock data above
  2. Please fix the failure unit test, you can check the log by clicking the details

dadiorchen avatar Mar 31 '24 00:03 dadiorchen

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. Screenshot 2024-04-08 at 11 32 47 AM

GuningShen avatar Apr 08 '24 15:04 GuningShen

@GuningShen sorry for the inconvenience, the final definition of stakeholder is here:

                          Table "stakeholder.stakeholder"
   Column   |           Type           | Collation | Nullable |      Default
------------+--------------------------+-----------+----------+--------------------
 id         | uuid                     |           | not null | uuid_generate_v4()
 type       | character varying        |           | not null |
 org_name   | character varying        |           |          |
 first_name | character varying        |           |          |
 last_name  | character varying        |           |          |
 email      | character varying        |           |          |
 phone      | character varying        |           |          |
 website    | character varying        |           |          |
 logo_url   | character varying        |           |          |
 map        | character varying        |           |          |
 created_at | timestamp with time zone |           | not null | now()
 updated_at | timestamp with time zone |           | not null | now()
 active     | boolean                  |           | not null | true
 entity_id  | integer                  |           |          |

The yaml file is out of date, so please mock the stakeholder based on this db structure.

dadiorchen avatar Apr 09 '24 08:04 dadiorchen

Aslo it would be great if you can raise a pr to update our yaml file in query API.

dadiorchen avatar Apr 09 '24 08:04 dadiorchen

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.

GuningShen avatar Apr 09 '24 16:04 GuningShen

@GuningShen sorry for the late review, could solve these conflict? we want to merge your pr

dadiorchen avatar Nov 02 '24 10:11 dadiorchen

@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?

GuningShen avatar Nov 02 '24 21:11 GuningShen