getDynamicText.tsx 379 B

123456789101112131415
  1. import {IS_ACCEPTANCE_TEST} from 'sentry/constants';
  2. /**
  3. * Return a specified "fixed" string when we are in a testing environment
  4. * (more specifically, when `IS_ACCEPTANCE_TEST` is true)
  5. */
  6. export default function getDynamicText<Value, Fixed = Value>({
  7. value,
  8. fixed,
  9. }: {
  10. fixed: Fixed;
  11. value: Value;
  12. }): Value | Fixed {
  13. return IS_ACCEPTANCE_TEST ? fixed : value;
  14. }