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

Shayan/feq116/add test for exchange rates hooks #8491

Conversation

shayan-deriv
Copy link
Member

Changes:

Please include a summary of the change and which issue is fixed below:

  • ...

When you need to add unit test

  • If this change disrupt current flow
  • If this change is adding new flow

When you need to add integration test

  • If components from external libraries are being used to define the flow, e.g. @deriv/components
  • If it relies on a very specific set of props with no default behavior for the current component.

Test coverage checklist (for reviewer)

  • Ensure utility / function has a test case
  • Ensure all the tests are passing

Type of change

  • Bug fix
  • New feature
  • Update feature
  • Refactor code
  • Translation to code
  • Translation to crowdin
  • Script configuration
  • Improve performance
  • Style only
  • Dependency update
  • Documentation update
  • Release

@vercel
Copy link

vercel bot commented May 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
deriv-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 10, 2023 5:16am

@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2023

A production App ID was automatically generated for this PR. (log)

Click here to copy & paste above information.
- **PR**: [https://github.com/binary-com/deriv-app/pull/8491](https://github.com/binary-com/deriv-app/pull/8491)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-shayan-deriv-shayan-feq116addtestfore-c47365.binary.sx?qa_server=red.binaryws.com&app_id=23831
    - **Original**: https://deriv-app-git-fork-shayan-deriv-shayan-feq116addtestfore-c47365.binary.sx
- **App ID**: `23831`

@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2023

🚨 Lighthouse report for the changes in this PR:

Category Score
🔺 Performance 18
🟧 Accessibility 75
🟢 Best practices 92
🟧 SEO 85
🟢 PWA 90

Lighthouse ran with https://deriv-app-git-fork-shayan-deriv-shayan-feq116addtestfore-c47365.binary.sx/

@codecov-commenter
Copy link

codecov-commenter commented May 7, 2023

Codecov Report

Merging #8491 (1254f64) into master (b51a956) will increase coverage by 0.19%.
The diff coverage is 55.55%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master    #8491      +/-   ##
==========================================
+ Coverage   20.81%   21.01%   +0.19%     
==========================================
  Files        1561     1561              
  Lines       36119    36120       +1     
  Branches     7091     7093       +2     
==========================================
+ Hits         7518     7589      +71     
+ Misses      27859    27781      -78     
- Partials      742      750       +8     
Impacted Files Coverage Δ
packages/hooks/src/useTotalAccountBalance.ts 70.00% <0.00%> (+70.00%) ⬆️
packages/stores/src/mockStore.ts 0.00% <0.00%> (ø)
packages/stores/src/storeProvider.tsx 88.88% <75.00%> (-11.12%) ⬇️
packages/hooks/src/useCFDAccounts.ts 100.00% <100.00%> (ø)

... and 9 files with indirect coverage changes

packages/hooks/src/__tests__/usePlatformAccounts.spec.tsx Outdated Show resolved Hide resolved
packages/hooks/src/__tests__/usePlatformAccounts.spec.tsx Outdated Show resolved Hide resolved
packages/hooks/src/__tests__/useCFDAccounts.spec.tsx Outdated Show resolved Hide resolved
packages/hooks/src/__tests__/useCFDAccounts.spec.tsx Outdated Show resolved Hide resolved
packages/hooks/src/__tests__/useCFDAccounts.spec.tsx Outdated Show resolved Hide resolved
packages/hooks/src/__tests__/useCFDAccounts.spec.tsx Outdated Show resolved Hide resolved
packages/hooks/src/__tests__/useGetCfdAccounts.spec.tsx Outdated Show resolved Hide resolved
shayan-deriv and others added 6 commits May 8, 2023 10:21
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
shayan-deriv and others added 13 commits May 8, 2023 12:01
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
packages/hooks/src/__tests__/useCFDAccounts.spec.tsx Outdated Show resolved Hide resolved
packages/hooks/src/__tests__/useCFDAccounts.spec.tsx Outdated Show resolved Hide resolved
packages/hooks/src/useCFDAccounts.ts Outdated Show resolved Hide resolved
packages/hooks/src/useCFDAccounts.ts Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented May 10, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
29.7% 29.7% Duplication

@github-actions
Copy link
Contributor

Generating Lighthouse report...

@sandeep-deriv sandeep-deriv merged commit b3a8935 into binary-com:master May 10, 2023
nijil-deriv pushed a commit to nijil-deriv/deriv-app that referenced this pull request May 24, 2023
* feat: adding new tests [WIP]

* fix: updated exchange_store provider for test files[co-authored by farzin-deriv]

* feat: new tests added [WIP]

* feat: useTotalCurrency's test added

* feat: test for useGetCfdAccounts added

* fix: adding remaining tests [WIP]

* feat: new tests added

* feat: new test added

* fix: fixing failed tests [WIP]

* feat: all tsts added

* Update packages/hooks/src/__tests__/usePlatformDemoAccount.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/usePlatformAccounts.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/usePlatformAccounts.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useTotalAssetCurrency.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useCFDAccounts.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useCFDAccounts.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useCFDAccounts.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useCFDAccounts.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* fix: resolved pr comments

* Update packages/hooks/src/__tests__/useTotalAssetCurrency.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useTotalAssetCurrency.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useTotalAssetCurrency.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useTotalAssetCurrency.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useTotalAssetCurrency.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useTotalAssetCurrency.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useTotalAssetCurrency.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useTotalAssetCurrency.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useCFDRealAccounts.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useTotalAccountBalance.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useCFDAllAccounts.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useCFDAllAccounts.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useCFDAllAccounts.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useCFDDemoAccounts.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useCFDDemoAccounts.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useCFDDemoAccounts.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useCFDRealAccounts.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* Update packages/hooks/src/__tests__/useCFDRealAccounts.spec.tsx

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>

* fix: fixed ts error in useTotalAccountBalance hook

* fix: resolved pr comment

* chore: renamed hook

---------

Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
@shayan-deriv shayan-deriv deleted the shayan/feq116/add_test_for_exchange_rates_hooks branch January 12, 2024 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants