520.604.1922 | nfinleymusic@gmail.com | github.com/Nfinley | linkedin.com/in/nigelfinley
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import {shallow} from 'enzyme'; | |
import $ComponentName$ from '$filepath$' | |
describe('$ComponentName$ Test', () => { | |
const props = {}; | |
const wrapper = shallow(<$ComponentName$ {...props}/>); | |
describe('$ComponentName$ State Test', () => { | |
it('Should have the correct state', () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import configureMockStore from 'redux-mock-store'; | |
import thunk from 'redux-thunk'; | |
import * as $actionFileName$ from './$actionFileName$'; | |
import * as Constants from '../constants/Constants'; | |
const middlewares = [thunk]; | |
const mockStore = configureMockStore(middlewares); | |
describe('$actionFileName$', () => { | |
//Test all actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import $reducerName$ from './$reducerName$'; | |
import * as $actionName$ from '../actions/$actionName$'; | |
//A reducer should return the new state after applying the action to the previous state | |
describe('$reducerName$ Reducer', () => { | |
const initialState = { | |
id: '', | |
name: 'test' | |
}; | |
const templates = [{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
const propTypes = {}; | |
const defaultProps = {}; | |
function $ComponentName$({ props }) { | |
return ( | |
<div className=""> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
class $ComponentName$ extends Component { | |
static propTypes = { | |
// myProp: PropTypes.string.isRequired | |
}; | |
static defaultProps = {}; | |
constructor(props) { |