From 46eae0a0b65e4064cd06658baf69957d37b503fe Mon Sep 17 00:00:00 2001 From: Matthew Shao Date: Mon, 5 Jun 2017 10:17:24 +0800 Subject: [PATCH] [web] Add tests for js/components/ContentView/DownloadContentButton.jsx --- .../ContentView/DownloadContentButtonSpec.js | 15 +++++++++++++++ .../DownloadContentButtonSpec.js.snap | 13 +++++++++++++ .../ContentView/DownloadContentButton.jsx | 1 + 3 files changed, 29 insertions(+) create mode 100644 web/src/js/__tests__/components/ContentView/DownloadContentButtonSpec.js create mode 100644 web/src/js/__tests__/components/ContentView/__snapshots__/DownloadContentButtonSpec.js.snap diff --git a/web/src/js/__tests__/components/ContentView/DownloadContentButtonSpec.js b/web/src/js/__tests__/components/ContentView/DownloadContentButtonSpec.js new file mode 100644 index 000000000..fd00627d9 --- /dev/null +++ b/web/src/js/__tests__/components/ContentView/DownloadContentButtonSpec.js @@ -0,0 +1,15 @@ +import React from 'react' +import renderer from 'react-test-renderer' +import DownloadContentButton from '../../../components/ContentView/DownloadContentButton' +import { TFlow } from '../../ducks/tutils' + +let tflow = new TFlow() +describe('DownloadContentButton Component', () => { + it('should render correctly', () => { + let downloadContentButton = renderer.create( + + ), + tree = downloadContentButton.toJSON() + expect(tree).toMatchSnapshot() + }) +}) diff --git a/web/src/js/__tests__/components/ContentView/__snapshots__/DownloadContentButtonSpec.js.snap b/web/src/js/__tests__/components/ContentView/__snapshots__/DownloadContentButtonSpec.js.snap new file mode 100644 index 000000000..66900ca4e --- /dev/null +++ b/web/src/js/__tests__/components/ContentView/__snapshots__/DownloadContentButtonSpec.js.snap @@ -0,0 +1,13 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`DownloadContentButton Component should render correctly 1`] = ` + + + +`; diff --git a/web/src/js/components/ContentView/DownloadContentButton.jsx b/web/src/js/components/ContentView/DownloadContentButton.jsx index 447db2114..f32a19ca4 100644 --- a/web/src/js/components/ContentView/DownloadContentButton.jsx +++ b/web/src/js/components/ContentView/DownloadContentButton.jsx @@ -1,3 +1,4 @@ +import React from 'react' import { MessageUtils } from "../../flow/utils" import PropTypes from 'prop-types'