Skip to content

Conversation

@kate-deriv
Copy link
Contributor

@kate-deriv kate-deriv commented May 26, 2023

Changes:

  • Migrate to TS and add unit tests for helpers functions in the trader package;
  • Going to delete unused functions

Screenshots:

Please provide some screenshots of the change.

@boring-cyborg boring-cyborg bot added the Trader label May 26, 2023
@vercel
Copy link

vercel bot commented May 26, 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 Jul 25, 2023 9:23am

@codecov-commenter
Copy link

codecov-commenter commented May 26, 2023

Codecov Report

Merging #8771 (4657b4f) into master (d5c38a0) will increase coverage by 0.00%.
The diff coverage is n/a.

❗ Current head 4657b4f differs from pull request most recent head 24b66bf. Consider uploading reports for the commit 24b66bf to get more accurate results

@@          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     

see 1 file with indirect coverage changes

@github-actions
Copy link
Contributor

github-actions bot commented May 26, 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/8771](https://github.com/binary-com/deriv-app/pull/8771)
- **URLs**:
    - **w/ App ID + Server**: https://vercel.live/open-feedback/deriv-app-git-fork-kate-deriv-kate-testtsheplersfunc.binary.sx?qa_server=red.binaryws.com&app_id=24072
    - **Original**: https://vercel.live/open-feedback/deriv-app-git-fork-kate-deriv-kate-testtsheplersfunc.binary.sx
- **App ID**: `24072`

@github-actions
Copy link
Contributor

github-actions bot commented May 26, 2023

🚨 Lighthouse report for the changes in this PR:

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

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');
Copy link
Contributor Author

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', () => {
Copy link
Contributor Author

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>) => {
Copy link
Contributor Author

@kate-deriv kate-deriv May 29, 2023

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.

@gitguardian
Copy link

gitguardian bot commented Jun 6, 2023

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
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
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. 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


🦉 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!

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

Generating Lighthouse report...

@coveralls
Copy link

coveralls commented Jul 7, 2023

Coverage Status

coverage: 8.897% (+0.01%) from 8.884% when pulling 24b66bf on kate-deriv:kate/test_ts_heplers_func into 7684e2c on binary-com:master.

@sonarqubecloud
Copy link

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 5 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@amina-deriv amina-deriv merged commit 1c7b78e into deriv-com:master Jul 31, 2023
matin-deriv pushed a commit to matin-deriv/deriv-app that referenced this pull request Aug 2, 2023
…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
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.

7 participants