This file contains hidden or 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 Options from './'; | |
describe('test Options component', () => { | |
it('instance method handleAdd should be triggered when add button gets clicked', () => { | |
const enzymeWrapper = shallow(<Options />); | |
enzymeWrapper.instance().handleAdd = jest.fn(); |
This file contains hidden or 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'; | |
export default class Options extends Component { | |
handleAdd = () => { | |
console.log('add'); | |
}; | |
handleEdit = () => { | |
console.log('edit'); | |
}; |
This file contains hidden or 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 Options from './'; | |
describe('test Options component', () => { | |
it('instance method handleAdd should be triggered when add button gets clicked', () => { | |
const enzymeWrapper = shallow(<Options />); | |
enzymeWrapper.instance().handleAdd = jest.fn(); |
This file contains hidden or 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'; | |
export default class Options extends Component { | |
handleAdd = () => { | |
console.log('add'); | |
}; | |
handleEdit = () => { | |
console.log('edit'); | |
}; |
This file contains hidden or 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 Card from './'; | |
describe('test Card component', () => { | |
it('should render the component', () => { | |
const enzymeWrapper = shallow(<Card />); | |
expect(enzymeWrapper).toHaveLength(1); |
This file contains hidden or 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 Card from './'; | |
describe('test Card component', () => { | |
it('should render the component', () => { | |
const enzymeWrapper = shallow(<Card />); | |
expect(enzymeWrapper).toHaveLength(1); |
This file contains hidden or 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 'tachyons/css/tachyons.min.css'; | |
export default class Card extends Component { | |
state = { | |
salute: false, | |
like: false, | |
}; |
This file contains hidden or 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
const { resolve } = require('path'); | |
module.exports = { | |
context: resolve(__dirname, '../'), | |
entry: ['babel-polyfill', './app/js/main.js'], | |
resolve: { | |
extensions: [ | |
'*', '.js', '.jsx', | |
], | |
modules: [ |
This file contains hidden or 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
"scripts": { | |
"development": "cross-env NODE_ENV=development env-cmd .env webpack-dev-server --config ./webpack", | |
"production": "cross-env NODE_ENV=production env-cmd .env webpack --config ./webpack", | |
"test": "cross-env NODE_ENV=test env-cmd .env jest --config ./jest.config.json" | |
} |
This file contains hidden or 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 axios from 'axios'; | |
const request = axios.create({ | |
baseURL: process.env.API_URL | |
}); | |
export default request; |