Skip to content

Commit

Permalink
Setup snapshot serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
yesmeck committed Feb 24, 2018
1 parent 11d4183 commit 383b1b3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
"setupFiles": [
"./tests/setup.js"
],
"snapshotSerializers": [
"enzyme-to-json/serializer"
],
"collectCoverageFrom": [
"src/**/*.{js,jsx}"
],
Expand Down
5 changes: 2 additions & 3 deletions tests/Range.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable max-len, no-undef */
import React from 'react';
import { render, mount } from 'enzyme';
import { renderToJson } from 'enzyme-to-json';
import Range from '../src/Range';
import createSliderWithTooltip from '../src/createSliderWithTooltip';

Expand All @@ -10,12 +9,12 @@ const RangeWithTooltip = createSliderWithTooltip(Range);
describe('Range', () => {
it('should render Range with correct DOM structure', () => {
const wrapper = render(<Range />);
expect(renderToJson(wrapper)).toMatchSnapshot();
expect(wrapper).toMatchSnapshot();
});

it('should render Multi-Range with correct DOM structure', () => {
const wrapper = render(<Range count={3} />);
expect(renderToJson(wrapper)).toMatchSnapshot();
expect(wrapper).toMatchSnapshot();
});

it('should render Range with value correctly', () => {
Expand Down
3 changes: 1 addition & 2 deletions tests/Slider.test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
/* eslint-disable max-len, no-undef */
import React from 'react';
import { render, mount } from 'enzyme';
import { renderToJson } from 'enzyme-to-json';
import keyCode from 'rc-util/lib/KeyCode';
import Slider from '../src/Slider';

describe('Slider', () => {
it('should render Slider with correct DOM structure', () => {
const wrapper = render(<Slider />);
expect(renderToJson(wrapper)).toMatchSnapshot();
expect(wrapper).toMatchSnapshot();
});

it('should render Slider with value correctly', () => {
Expand Down

0 comments on commit 383b1b3

Please sign in to comment.