Closed bmulholland closed 7 months ago
Can we just follow these instructions and the overrides will apply to the Vue component's state?
Yep, I think this is the simplest approach. Flag overrides should work with the Vue plugin just fine.
Is there another way to force the value to be something?
Alternatively, providing a mock for IConfigCatClient
could work as well, since it's injected as a dependency. You'd need to provide some fake implementation of IConfigCatClient.snaphot()
, plus of IConfigCatClient.on("configChanged", ...)
if you want to test state transitions.
FYI, we've added a few tests recently, so now we have some examples of how to apply those mocking techniques I talked about in my previous comment: https://github.com/codedbychavez/configcat-vue/blob/main/tests/unit/FeatureWrapper.spec.ts
Closing...
We need to write unit & e2e tests that cover both states of the feature flipper. How do we do that? Can we just follow these instructions and the overrides will apply to the Vue component's state? Is there another way to force the value to be something? Would need to be at runtime, e.g. in the browser, I think.