Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 1.51 KB

File metadata and controls

38 lines (24 loc) · 1.51 KB

Mocking Data

This guide covers various methods of mocking data while developing or testing Cloud Manager.

Mocking APIv4

Coming soon: tutorial on factories and intercepting network requests.

Mocking feature flags

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_ID defined in .env, or:
  • Block network requests to *launchdarkly*.

To run Cloud Manager with specific values assigned to feature flags:

  1. Run Cloud Manager without feature flags using a method listed above.
  2. Open src/containers/withFeatureFlagProvider.container.ts.
  3. Supply an options.bootstrap map to withLDProvider.

Example:

options: {
  bootstrap: {
    isFeatureEnabled: true; // <-- Mocked flags here.
  }
}

Changing user preferences

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.