dynamicWrapper.spec.jsx 834 B

1234567891011121314151617181920212223242526272829
  1. import React from 'react';
  2. import {shallow} from 'enzyme';
  3. import DynamicWrapper from 'app/components/dynamicWrapper';
  4. describe('DynamicWrapper', function() {
  5. let sandbox;
  6. beforeEach(function() {
  7. sandbox = sinon.sandbox.create();
  8. });
  9. afterEach(function() {
  10. sandbox.restore();
  11. });
  12. it('renders actual value', function() {
  13. let wrapper = shallow(<DynamicWrapper fixed="Test" value="Dynamic Content" />);
  14. expect(wrapper).toMatchSnapshot();
  15. });
  16. it('renders fixed content when `process.env.IS_PERCY` is true', function() {
  17. // eslint-disable-next-line no-undef
  18. process.env.IS_PERCY = true;
  19. let wrapper = shallow(<DynamicWrapper fixed="Test" value="Dynamic Content" />);
  20. expect(wrapper).toMatchSnapshot();
  21. // eslint-disable-next-line no-undef
  22. process.env.IS_PERCY = null;
  23. });
  24. });