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

Introduction of unit test suite #1349

Merged
merged 4 commits into from
Feb 12, 2024
Merged

Introduction of unit test suite #1349

merged 4 commits into from
Feb 12, 2024

Conversation

adamgall
Copy link
Member

@adamgall adamgall commented Feb 10, 2024

Description

This PR introduces unit tests to the project, using vitest (a recommended unit testing framework by Next.js).

Notes

This PR is the result of a production but that Shutter encountered, in which they crafted a proposal which included transactions that took bool values -- notably ones that should be "false" -- and our UI created encoded transaction data which included those bool values as "true" (0000000000000000000000000000000000000000000000000000000000000001), not "false (0000000000000000000000000000000000000000000000000000000000000000).

Issue / Notion doc (if applicable)

n/a

Testing

npm install # to install new dependencies
npm run test

All tests in this PR should pass.

There is one test which is commented out, because it will fail right now. This commented out test is the reason for this PR in the first place -- we have a bug in our function encoding code (./src/utils/crypto.ts) that turns the function parameter string "false" into an encoded value of true.

@mudrila after you implement a fix to the encodeFunction function in ./src/utils/crypto.ts in a later PR, you should please un-comment this remaining test and it should pass.

Screenshots (if applicable)

n/a

@adamgall adamgall requested review from mudrila and Da-Colon February 10, 2024 20:09
Copy link

netlify bot commented Feb 10, 2024

Deploy Preview for fractal-framework-interface-dev ready!

Name Link
🔨 Latest commit 91b7714
🔍 Latest deploy log https://app.netlify.com/sites/fractal-framework-interface-dev/deploys/65c7e8d5e0545d00084d091e
😎 Deploy Preview https://deploy-preview-1349--fractal-framework-interface-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mudrila mudrila merged commit 56301d3 into develop Feb 12, 2024
5 of 6 checks passed
@mudrila mudrila deleted the unit-tests branch February 12, 2024 09:17
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.

2 participants