diff --git a/frontend/components/common.spec.js b/frontend/components/common.spec.js new file mode 100644 index 0000000000..1dfb6a5417 --- /dev/null +++ b/frontend/components/common.spec.js @@ -0,0 +1,67 @@ +import React from 'react' +import { shallow, render } from 'enzyme' +import { expect } from 'chai' +import * as common from './common' + +import './enzyme-conf.spec' + +describe('Common modules', function() { + describe('', function() { + it('renders', function() { + shallow() + }) + }) + + describe('', function() { + it('renders', function() { + shallow() + }) + }) + + describe('

', function() { + it('renders', function() { + shallow() + }) + }) + + describe('

', function() { + it('renders', function() { + shallow() + }) + }) + + describe('', function() { + it('renders', function() { + shallow() + }) + + it('contains a link to the image', function() { + const wrapper = render() + expect(wrapper.html()).to.contain('', function() { + it('renders', function() { + shallow() + }) + }) + + describe('', function() { + it('renders', function() { + shallow() + }) + }) + + describe('', function() { + it('renders', function() { + shallow() + }) + }) + + describe('', function() { + it('renders', function() { + shallow() + }) + }) +}) diff --git a/frontend/components/donate.spec.js b/frontend/components/donate.spec.js new file mode 100644 index 0000000000..43f123672b --- /dev/null +++ b/frontend/components/donate.spec.js @@ -0,0 +1,17 @@ +import React from 'react' +import { shallow, render } from 'enzyme' +import { expect } from 'chai' +import Donate from './donate' + +import './enzyme-conf.spec' + +describe('', function() { + it('renders', function() { + shallow() + }) + + it('contains a link to open collective', function() { + const wrapper = render() + expect(wrapper.html()).to.contain('https://opencollective.com/shields') + }) +}) diff --git a/frontend/components/main.spec.js b/frontend/components/main.spec.js new file mode 100644 index 0000000000..a94d4923b6 --- /dev/null +++ b/frontend/components/main.spec.js @@ -0,0 +1,21 @@ +import React from 'react' +import { shallow } from 'enzyme' +import Main from './main' + +import './enzyme-conf.spec' + +describe('
', function() { + it('renders without a category', function() { + shallow(
) + }) + + it('renders with a category', function() { + shallow( +
+ ) + }) +}) diff --git a/frontend/components/usage.spec.js b/frontend/components/usage.spec.js index 92a7ce9d49..a2a2cf2c09 100644 --- a/frontend/components/usage.spec.js +++ b/frontend/components/usage.spec.js @@ -14,4 +14,11 @@ describe('', function() { const wrapper = shallow() expect(wrapper).to.contain.text('use them responsibly') }) + + // This test requires Link to be mocked. + // const wrapper = render() + // expect(wrapper.html()).to.contain( + // 'needed for spaces or special characters!' + // ) + // }) })