-
Notifications
You must be signed in to change notification settings - Fork 97
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
feat(multichain): Use new dynamic config for multichain features #4265
Conversation
…allet into jophish/multi-chain-statsig
Codecov Report
@@ Coverage Diff @@
## main #4265 +/- ##
==========================================
- Coverage 83.96% 83.95% -0.01%
==========================================
Files 705 705
Lines 25989 25985 -4
Branches 3378 3372 -6
==========================================
- Hits 21821 21817 -4
- Misses 4103 4104 +1
+ Partials 65 64 -1
Continue to review full report in Codecov by Sentry.
|
@@ -18,6 +18,11 @@ import { mockCusdAddress } from 'test/values' | |||
|
|||
jest.mock('src/statsig', () => ({ | |||
getFeatureGate: jest.fn(() => false), | |||
getDynamicConfigParams: jest.fn(() => ({ |
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.
Noticed these in a bunch of test files, are the mocks on these test files required because there's a nested dependency to this dynamic config? And is the getFeatureGate mock now required? I wonder if we should consider creating a shared mock under __mocks__
similar to how navigate / analytics is mocked so we don't need this everywhere
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.
That's correct, re: nested dependency. And yes, the getFeatureGate
mock is still required here. And interesting -- I haven't messed around with shared mocks before. How would that work? Would there be a mock for the entirety of src/statsig
that would automatically be included in all tests? What if we want to override this mock (which will certainly be the case)?
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.
yes it would mock src/statsig
for all tests. We can still setup test specific mocks as we do normally and it will override this mock. In any case its outside the scope of this PR, but something to consider if we have more of these shared mocks.
@@ -18,6 +18,11 @@ import { mockCusdAddress } from 'test/values' | |||
|
|||
jest.mock('src/statsig', () => ({ | |||
getFeatureGate: jest.fn(() => false), | |||
getDynamicConfigParams: jest.fn(() => ({ |
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.
yes it would mock src/statsig
for all tests. We can still setup test specific mocks as we do normally and it will override this mock. In any case its outside the scope of this PR, but something to consider if we have more of these shared mocks.
Description
For ACT-931. Replaces three of our existing feature gates with a single Statsig Dynamic Config (available here).
The
show_native_tokens
feature gate is a straggler here in terms of multichain config. This was added as part of a quick and dirty hack to get non-Celo transfers showing up in the home feed a while back, and ought to be removed. I'll remove this in a followup PR.Test plan
Manual and unit tested.
Related issues
Backwards compatibility
Yes.