Skip to content

Commit

Permalink
update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhang740 committed Aug 23, 2017
1 parent f262a05 commit 238b277
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 0 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
"coverage:upload": "npm run coverage && cat ./coverage/lcov.info | coveralls"
},
"jest": {
"testMatch": [
"**/__tests__/**/*.ts?(x)",
"**/?(*.)(spec|test).ts?(x)"
],
"coverageDirectory": "./coverage/",
"moduleFileExtensions": [
"ts",
Expand Down
36 changes: 36 additions & 0 deletions tests/Calendar.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from 'react';
import { render } from 'enzyme';
import { renderToJson } from 'enzyme-to-json';
import { Calendar, Locale } from '../src';

describe('Calendar', () => {
it('base.', () => {
const wrapper = render(
<Calendar
/>
);
expect(renderToJson(wrapper)).toMatchSnapshot();
});

it('show shortcut.', () => {
const wrapper = render(
<Calendar
visible={true}
showShortcut={true}
/>
);
expect(renderToJson(wrapper)).toMatchSnapshot();
});
});

describe('Calendar english.', () => {
it('renders correctly', () => {
const wrapper = render(
<Calendar
visible={true}
locale={Locale.enUS}
/>
);
expect(renderToJson(wrapper)).toMatchSnapshot();
});
});
14 changes: 14 additions & 0 deletions tests/DatePicker.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import { render } from 'enzyme';
import { renderToJson } from 'enzyme-to-json';
import { DatePicker } from '../src';

describe('DatePicker', () => {
it('renders correctly', () => {
const wrapper = render(
<DatePicker
/>
);
expect(renderToJson(wrapper)).toMatchSnapshot();
});
});
File renamed without changes.
File renamed without changes.

0 comments on commit 238b277

Please sign in to comment.