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 Taxes page #40837

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:

melvin-bot[bot] commented 1 week ago

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

melvin-bot[bot] commented 1 week ago

Triggered auto assignment to @zanyrenney (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.

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 Taxes page

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

dukenv0307 commented 1 week ago

It's not a bug issue so we can assign @tienifr. BTW, we haven't set the price for that ticket yet @luacmartins

🎀👀🎀 C+ reviewed

melvin-bot[bot] commented 1 week ago

Current assignee @luacmartins is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

melvin-bot[bot] commented 1 week ago

Job added to Upwork: https://www.upwork.com/jobs/~01aabb7c33e3cc9759

melvin-bot[bot] commented 1 week ago

Current assignee @dukenv0307 is eligible for the External assigner, not assigning anyone new.

tienifr commented 1 week ago

@dukenv0307 PR https://github.com/Expensify/App/pull/41059 is ready