getDynamicText.spec.jsx 641 B

12345678910111213141516171819202122232425
  1. import getDynamicText from 'app/utils/getDynamicText';
  2. describe('getDynamicText', function() {
  3. it('renders actual value', function() {
  4. expect(
  5. getDynamicText({
  6. fixed: 'Text',
  7. value: 'Dynamic Content',
  8. })
  9. ).toEqual('Dynamic Content');
  10. });
  11. it('renders fixed content when `process.env.IS_PERCY` is true', function() {
  12. // eslint-disable-next-line no-undef
  13. process.env.IS_PERCY = true;
  14. expect(
  15. getDynamicText({
  16. fixed: 'Text',
  17. value: 'Dynamic Content',
  18. })
  19. ).toEqual('Text');
  20. // eslint-disable-next-line no-undef
  21. process.env.IS_PERCY = null;
  22. });
  23. });