Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
2.97k stars 2.48k forks source link

[$250] Create automated tests for Workspace Profile, Members and Categories pages #40835

Open luacmartins opened 1 week ago

luacmartins commented 1 week ago

Problem

New API commands introduced as part of the Simplified Collect project don't have automated tests, which can lead to bugs and unexpected behavior when these commands are updated.

Solution

Add automated tests for the commands below:

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011452b1c44ee7036a
  • Upwork Job ID: 1782893496746893312
  • Last Price Increase: 2024-04-23
  • Automatic offers:
    • hoangzinh | Reviewer | 0
    • tienifr | Contributor | 0
melvin-bot[bot] commented 1 week ago

Triggered auto assignment to @mallenexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

melvin-bot[bot] commented 1 week ago

Job added to Upwork: https://www.upwork.com/jobs/~011452b1c44ee7036a

melvin-bot[bot] commented 1 week ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (External)

tienifr commented 1 week ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

We need to add automated tests for new API commands in Workspace Profile, Members and Categories pages

What is the root cause of that problem?

This is new requirement, currently we don't have any automated tests for those commands

What changes do you think we should make in order to solve the problem?

For each command, we need to:

  1. Define the test scenarios for the command, this will be the different cases that the input params of the command function (for example this) can take. Eg. If a param is optional, we need to test both scenarios where that params is, and is not provided. And there should be the scenarios for different user's use cases as well, we can check this by testing the flow in the UI to see what possible values/actions they can take that influence the command input.

  2. Write unit tests with those scenarios, given a set of command function input, we need to check that API.write/API.read are called with a correct set of parameters and onyxData (eg. this call).

For how to write it, we'll write Jest tests just like we did for other utils like here

What alternative solutions did you explore? (Optional)

NA

hoangzinh commented 1 week ago

@luacmartins I am concerned that those automation tests should be added to BE repository or this Expensify/App repository?

luacmartins commented 1 week ago

@hoangzinh the backend already has automated tests. We need to also include it in App

luacmartins commented 1 week ago

I think @tienifr's proposal looks good. Gonna assign them to this issue.

melvin-bot[bot] commented 1 week ago

📣 @hoangzinh 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] commented 1 week ago

📣 @tienifr 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻 Keep in mind: Code of Conduct | Contributing 📖

tienifr commented 1 week ago

@hoangzinh PR https://github.com/Expensify/App/pull/41050 is ready