UNPKG

805 BJavaScriptView Raw
1module.exports = function(name, upper){
2
3return `
4import React from 'react';
5import { shallow, mount, render } from 'enzyme';
6import chai, { expec } from 'chai';
7
8chai.use(chaiEnzyme());
9
10import {${name} as ${upper}} from './${upper}';
11import /* store-name */ from /* store-name */;
12
13describe('${upper}', ()=> {
14 let ${name};
15
16 describe('with props set', ()=> {
17 let props = {/* add props and store here */};
18
19 beforeEach(()=>{
20 ${name} = mount(
21 <${upper} {...props} />
22 );
23 });
24
25 it('exists', ()=> {
26 expect(${name}).to.exist;
27 });
28
29 });
30
31 describe('with props not set', ()=> {
32 beforeEach(()=> {
33 ${name} = mount(
34 <${upper} />
35 );
36 });
37
38 });
39});
40`;
41
42}
\No newline at end of file