Skip to content
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

Added More Unit Test For Product Feature #1061

Merged
merged 6 commits into from
Aug 22, 2024
Merged

Conversation

niyajali
Copy link
Member

Adds unit tests for AddEditProductViewModel and ProductSettingsViewModel.

The
AddEditProductViewModelTest includes tests for:

  • Empty and populated categories
  • Initializing with a valid product ID
  • Updating product details
  • Validating category, name, price, and tag inputs
  • Creating and updating products

The ProductSettingsViewModelTest includes tests for: -
Empty and available categories

  • Selecting and deselecting categories
  • Changing product price
  • Increasing and decreasing product prices with and without selections
  • Exporting products with and without selections

Adds unit tests for `AddEditProductViewModel` and `ProductSettingsViewModel`.

The
 `AddEditProductViewModelTest` includes tests for:
- Empty and populated categories
- Initializing with a valid product ID
- Updating product details
- Validating category, name, price, and tag inputs
- Creating and updating products

The `ProductSettingsViewModelTest` includes tests for:
-
 Empty and available categories
- Selecting and deselecting categories
- Changing product price
- Increasing and decreasing product prices with and without selections
- Exporting products with and without selections
niyajali and others added 5 commits August 20, 2024 13:19
* Updated ExpensePreviewParameter with new data
* Removed unnecessary toPrettyDate function call
* Updated ExpensesEndToEnd
Test with new data and assertions
* Updated Expenses End to End Test
    * Reduced the number of expenses created in the test from
3 to 2.
    * Added a swipe-up action on the expense list to ensure visibility of all items.
    * Updated assertions to reflect the change in the number of expenses.
* Updated Expenses Screen Test
    * Modified the test to check the display of the first 2 items instead of
 3.
    * Ensured the displayed items have click actions.
This commit removes the steps in the CI workflow that were responsible for uploading unit test, lint, android
 test, and local coverage reports to Slack.
@niyajali niyajali merged commit d5d2864 into main Aug 22, 2024
5 checks passed
Copy link
Contributor

Combined test coverage report

Overall Project 28.37% -0.01%
Files changed 78% 🍏

Module Coverage
product 39.62% -0.07% 🍏
ui 0.49% -0.01%
Files
Module File Coverage
product AddEditProductViewModel.kt 90.78% 🍏
ProductCard.kt 71.2% -0.91%
ImportProductScreen.kt 38.32% 🍏
ExportProductScreen.kt 35.02% 🍏
IncreaseProductPriceScreen.kt 34.21% 🍏
DecreaseProductPriceScreen.kt 33.87% 🍏
ProductScreen.kt 27.98% -0.28%
ui MarketItemAndQuantityWithDifferentTypePreviewParameter.kt 0% -0.49%
CustomersPreviewParameter.kt 0% -0.57%
ExpensePreviewParameter.kt 0% -0.42%

@niyajali niyajali deleted the testing/product-testing branch August 25, 2024 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant