1 | module.exports = function(name, upper){
|
2 |
|
3 | return `
|
4 | import React from 'react';
|
5 | import { shallow, mount, render } from 'enzyme';
|
6 | import chai, { expec } from 'chai';
|
7 |
|
8 | chai.use(chaiEnzyme());
|
9 |
|
10 | import {${name} as ${upper}} from './${upper}';
|
11 | import /* store-name */ from /* store-name */;
|
12 |
|
13 | describe('${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 |