This guide covers various methods of mocking data while developing or testing Cloud Manager.
Coming soon: tutorial on factories and intercepting network requests.
Cloud Manager uses LaunchDarkly for feature flag management.
To run Cloud Manager without feature flags enabled, either:
- Run the app without
REACT_APP_LAUNCH_DARKLY_IDdefined in.env, or: - Block network requests to
*launchdarkly*.
To run Cloud Manager with specific values assigned to feature flags:
- Run Cloud Manager without feature flags using a method listed above.
- Open
src/containers/withFeatureFlagProvider.container.ts. - Supply an
options.bootstrapmap towithLDProvider.
Example:
options: {
bootstrap: {
isFeatureEnabled: true; // <-- Mocked flags here.
}
}Since user preferences are tied to OAuth clients, to change Cloud Manager preferences you must grab the short-lived token from the app and use that to curl.
As a convenience, there is a preference editor in Cloud accessible by going to /profile/settings?preferenceEditor=true. It allows you to enter arbitrary JSON and submit it (validating that it's valid JSON first). This makes it easier to quickly edit preferences when developing features that depend on it.