From 3d51595b27c6e24a377166a2dc793c0f271ed612 Mon Sep 17 00:00:00 2001 From: Matthew Shao Date: Tue, 6 Jun 2017 19:04:40 +0800 Subject: [web] Add tests for js/components/ContentView/UploadContentButton.jsx --- .../components/ContentView/UploadContentButtonSpec.js | 12 ++++++++++++ .../__snapshots__/UploadContentButtonSpec.js.snap | 19 +++++++++++++++++++ .../js/components/ContentView/UploadContentButton.jsx | 1 + 3 files changed, 32 insertions(+) create mode 100644 web/src/js/__tests__/components/ContentView/UploadContentButtonSpec.js create mode 100644 web/src/js/__tests__/components/ContentView/__snapshots__/UploadContentButtonSpec.js.snap (limited to 'web') diff --git a/web/src/js/__tests__/components/ContentView/UploadContentButtonSpec.js b/web/src/js/__tests__/components/ContentView/UploadContentButtonSpec.js new file mode 100644 index 00000000..3695be72 --- /dev/null +++ b/web/src/js/__tests__/components/ContentView/UploadContentButtonSpec.js @@ -0,0 +1,12 @@ +import React from 'react' +import renderer from 'react-test-renderer' +import UploadContentButton from '../../../components/ContentView/UploadContentButton' + +describe('UpdateContentButton Component', () => { + it('should render correctly', () => { + let uploadContentFn = jest.fn(), + uploadContentButton = renderer.create(), + tree = uploadContentButton.toJSON() + expect(tree).toMatchSnapshot() + }) +}) diff --git a/web/src/js/__tests__/components/ContentView/__snapshots__/UploadContentButtonSpec.js.snap b/web/src/js/__tests__/components/ContentView/__snapshots__/UploadContentButtonSpec.js.snap new file mode 100644 index 00000000..f642d731 --- /dev/null +++ b/web/src/js/__tests__/components/ContentView/__snapshots__/UploadContentButtonSpec.js.snap @@ -0,0 +1,19 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`UpdateContentButton Component should render correctly 1`] = ` + + + + +`; diff --git a/web/src/js/components/ContentView/UploadContentButton.jsx b/web/src/js/components/ContentView/UploadContentButton.jsx index 0021593f..847d4eb0 100644 --- a/web/src/js/components/ContentView/UploadContentButton.jsx +++ b/web/src/js/components/ContentView/UploadContentButton.jsx @@ -1,3 +1,4 @@ +import React from 'react' import PropTypes from 'prop-types' import FileChooser from '../common/FileChooser' -- cgit v1.2.3