From 5bd8977d75ba0de9eeb66a506904d7ed02364738 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Wed, 23 Nov 2016 16:31:54 +0800 Subject: [PATCH] Datepicker locale demo test --- tests/date-picker/demo.test.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/date-picker/demo.test.js b/tests/date-picker/demo.test.js index 02f56fb651..b448d6dfda 100644 --- a/tests/date-picker/demo.test.js +++ b/tests/date-picker/demo.test.js @@ -1,3 +1,14 @@ +import { render } from 'enzyme'; +import { renderToJson } from 'enzyme-to-json'; +import MockDate from 'mockdate'; import demoTest from '../shared/demoTest'; -demoTest('date-picker'); +demoTest('date-picker', { skip: [ 'locale.md' ] }); + +test('renders ./components/date-picker/demo/locale.md correctly', () => { + MockDate.set(new Date('2016-11-22').getTime()); + const LocaleDemo = require('../../components/date-picker/demo/locale'); + const wrapper = render(LocaleDemo); + expect(renderToJson(wrapper)).toMatchSnapshot(); + MockDate.reset(); +});