paweldomas adec8e6438 ref(TestHint): render only in test mode
Adds the logic to render TestHint only when the test mode is enabled
in order to be able to put independent TestHints in other places than
the TestConnectionInfo component.
2018-04-19 16:49:22 -05:00

16 lines
498 B
JavaScript

// @flow
/**
* Indicates whether the test mode is enabled. When it's enabled
* {@link TestHint} and other components from the testing package will be
* rendered in various places across the app to help with automatic testing.
*
* @param {Object} state - The redux store state.
* @returns {boolean}
*/
export function isTestModeEnabled(state: Object): boolean {
const testingConfig = state['features/base/config'].testing;
return Boolean(testingConfig && testingConfig.testMode);
}