splitDiff.spec.jsx 722 B

12345678910111213141516171819202122232425262728293031
  1. import React from 'react';
  2. import {shallow} from 'enzyme';
  3. import SplitDiff from 'app/components/splitDiff';
  4. describe('SplitDiff', function() {
  5. let sandbox;
  6. beforeEach(function() {
  7. sandbox = sinon.sandbox.create();
  8. });
  9. afterEach(function() {
  10. sandbox.restore();
  11. });
  12. it('renders', function() {
  13. let wrapper = shallow(<SplitDiff base="restaurant" target="aura" />);
  14. expect(wrapper).toMatchSnapshot();
  15. });
  16. it('renders with newlines', function() {
  17. let base = `this is my restaurant
  18. and restaurant
  19. common`;
  20. let target = `aura
  21. and your aura
  22. common`;
  23. let wrapper = shallow(<SplitDiff base={base} target={target} />);
  24. expect(wrapper).toMatchSnapshot();
  25. });
  26. });