market
market copied to clipboard
added @shared components stories
- Fixes #1400
Changes proposed in this PR:
- added ...
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
market | ✅ Ready (Inspect) | Visit Preview | Jul 7, 2022 at 11:07AM (UTC) |
1 Ignored Deployment
Name | Status | Preview | Updated |
---|---|---|---|
market-v3 | ⬜️ Ignored (Inspect) | Jul 7, 2022 at 11:07AM (UTC) |
Please @claudiaHash take some time to review the market as this last commit touches few files. Also, it will break the CI, but I'd prefer to bring some of the work to review while I'm trying to fix the CI issues.
Please @claudiaHash take some time to review the market as this last commit touches few files. Also, it will break the CI, but I'd prefer to bring some of the work to review while I'm trying to fix the CI issues.
Even though the locale
change brings some modifications in a lot of files, from a writing stories perspective it makes our job easier
Please @claudiaHash take some time to review the market as this last commit touches few files. Also, it will break the CI, but I'd prefer to bring some of the work to review while I'm trying to fix the CI issues.
Even though the
locale
change brings some modifications in a lot of files, from a writing stories perspective it makes our job easier
Yeah. I couldn't find a way to work around all the issues that our hooks create on storybook and testing.
I found also that our script to automate the tests is actually running some tests twice or is ignoring our customs .test
files.
For example: I'm working on AssetList. This component needs a custom .test
file to run correctly. The custom test runs correctly, but the automated script also runs on the component which fails because it's missing what's on our custom .test
file.
Our custom AssetList/index.test.tsx
passes, but .storybook/storyshots.test.tsx
fails
This is the automated test
If you run the single test npm run jest AssetList
, it passes 😅

Greener and greener 💚

Test coverage is on the rise. We still need to deal with a couple of issues:
- Automated test fails:
@shared/FormFields/AssetSelection/index.stories.tsx

- Automated test fails:
@shared/AssetList/index.tsx
(manual test passes)

Code Climate has analyzed commit b3260d88 and detected 4 issues on this pull request.
Here's the issue category breakdown:
Category | Count |
---|---|
Complexity | 1 |
Duplication | 3 |
The test coverage on the diff in this pull request is 14.1% (50% is the threshold).
This pull request will bring the total coverage in the repository to 13.0% (7.9% change).
View more on Code Climate.
just quickly looking over this, refactoring all components to not use any hooks is not feasible. That's the point of hooks, to not using a gazillion props on everything, which for some components this PR now does.
You need to mock hooks like useWeb3()
or useUserPreferences()
so that whenever Jest runs, those hook calls in the components are returning your mocked values.
Let's recap the current state of this PR before moving forward.
Current State of the Art:

Issues unsolved:
-
[ ] Automated test should stop when encountered
console.error
-
[ ] Automated test should ignore components with custom
.test.tsx
file passed (see here) -
[ ] Test failing on package
is-url-superb
-
[ ]
Error fetchData: Cannot read properties of undefined (reading query)
: errors with contexts (we need to mock correctly the context as suggested). Example: MarketMetadataContext -
[ ]
An update to AssetList inside a test was not wrapped in act
: see here
As for right now, We should stop moving forward as these are critical issues we need to solve to be able to keep going effectively. As stated previously, we need to mock our context providers. At that point we'll probably endup with custom .test.tsx
files to maintain. At the moment we don't see feasible decoupling logic from UI, and also doesn't make much sense to keep going on storybook if we'll need to do custom work on the testing side of things. On that regard, we wanted to ask you @kremalicious, what you think is the best way to move forward here?
can be ignored for now, huge merge conflict is not worth solving here. Have another branch prepared where some of the things in here are copied over