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 ${upper} from './${upper}';
|
11 |
|
12 | describe('${upper}', ()=> {
|
13 | let ${name};
|
14 |
|
15 | describe('with props set', ()=> {
|
16 | let props = {/* add props here */};
|
17 |
|
18 | beforeEach(()=>{
|
19 | ${name} = mount(
|
20 | <${upper} {...props} />
|
21 | );
|
22 | });
|
23 |
|
24 | it('exists', ()=> {
|
25 | expect(${name}).to.exist;
|
26 | });
|
27 |
|
28 | });
|
29 |
|
30 | describe('with props not set', ()=> {
|
31 | beforeEach(()=> {
|
32 | ${name} = mount(
|
33 | <${upper} />
|
34 | );
|
35 | });
|
36 |
|
37 | });
|
38 | });
|
39 | `
|
40 | } |
\ | No newline at end of file |