getDynamicText.stories.js 665 B

1234567891011121314151617181920212223242526272829
  1. import React from 'react';
  2. import {withInfo} from '@storybook/addon-info';
  3. import getDynamicText from 'app/utils/getDynamicText';
  4. export default {
  5. title: 'Utility/getDynamicText',
  6. };
  7. export const GetDynamicText = withInfo(
  8. `
  9. Use this to wrap dynamic content (i.e. dates) for acceptance/snapshot tests.
  10. Currently checks for IS_CI env var.
  11. (webpack config has webpack.DefinePlugin for "process.env.IS_CI")
  12. `
  13. )(() => {
  14. return (
  15. <React.Fragment>
  16. {getDynamicText({
  17. fixed: 'Fixed Content',
  18. value: 'Pretend this is a dynamic value',
  19. })}
  20. </React.Fragment>
  21. );
  22. });
  23. GetDynamicText.story = {
  24. name: 'getDynamicText',
  25. };