dynamicWrapper.spec.jsx 755 B

1234567891011121314151617181920212223
  1. import React from 'react';
  2. import {shallow} from 'enzyme';
  3. import DynamicWrapper from 'app/components/dynamicWrapper';
  4. describe('DynamicWrapper', function() {
  5. beforeEach(function() {});
  6. afterEach(function() {});
  7. it('renders actual value', function() {
  8. const wrapper = shallow(<DynamicWrapper fixed="Test" value="Dynamic Content" />);
  9. expect(wrapper).toMatchSnapshot();
  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. const wrapper = shallow(<DynamicWrapper fixed="Test" value="Dynamic Content" />);
  15. expect(wrapper).toMatchSnapshot();
  16. // eslint-disable-next-line no-undef
  17. process.env.IS_PERCY = null;
  18. });
  19. });