-
Notifications
You must be signed in to change notification settings - Fork 392
Kate / TS migration + Tests for Helpers files in Trader package #8771
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
Kate / TS migration + Tests for Helpers files in Trader package #8771
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report
@@ Coverage Diff @@
## master #8771 +/- ##
======================================
Coverage 0.05% 0.05%
======================================
Files 117 117
Lines 3425 3422 -3
Branches 893 891 -2
======================================
Hits 2 2
+ Misses 3423 3420 -3 |
|
A production App ID was automatically generated for this PR. (log)
Click here to copy & paste above information. |
|
🚨 Lighthouse report for the changes in this PR:
Lighthouse ran with https://deriv-app-git-fork-kate-deriv-kate-testtsheplersfunc.binary.sx/ |
| @@ -1 +1,5 @@ | |||
| module.exports = require('../../jest.config.base'); | |||
| const baseConfigForPackages = require('../../jest.config.base'); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 3 files for jest were added here because of a system issue: No tests found, exiting with code 1. It'll be fixed separately in Farzin PR, but it was necessary to include it here too in order to run tests.
| }, | ||
| ]; | ||
|
|
||
| describe('getContractTypeCategoryIcons', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In contract-type.tsx there were 4 functions in one file to be tested (getContractTypeCategoryIcons, getAvailableContractTypes, getContractCategoryKey, getContractTypes), that is why I created a separate describe section for each of them.
| * @param {array} filtered_items_array - list of filtered contract category names and/or contract types names | ||
| */ | ||
| export const getFilteredList = (contract_types_list, filtered_items_array) => { | ||
| /*export const getFilteredList = (contract_types_list, filtered_items_array: Array<string>) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented getFilteredList, flatten and getContractsList functions as they are not being used anywhere. I wasn't able to find files where they were imported. Not sure if I should delete it as we might need them in future.
05fc604 to
fbc8c66
Compare
packages/trader/src/Modules/Trading/Helpers/__tests__/contract-type.spec.tsx
Outdated
Show resolved
Hide resolved
|
| GitGuardian id | Secret | Commit | Filename | |
|---|---|---|---|---|
| - | Generic High Entropy Secret | 3d13477 | packages/account/src/Components/currency-selector/tests/currency-selector.spec.tsx | View secret |
| - | Generic High Entropy Secret | 3d13477 | packages/account/src/Components/currency-selector/tests/currency-selector.spec.tsx | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
|
⏳ Generating Lighthouse report... |
|
Kudos, SonarCloud Quality Gate passed!
|
…v-com#8771) * refactor: ts and tests for helpes functions * feat: change jest config in prder to enable tests * refactor: add test for the rest of the functions * chore: delete return in function * chore: revert old jest config * refactor: apply suggestions from review * chore: correct types names








Changes:
Screenshots:
Please provide some screenshots of the change.