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
{ | |
"name": "project-name", | |
"description": "Template for static sites", | |
"version": "1.0.0", | |
"homepage": "http://www.project-name.com", | |
"author": { | |
"name": "Adam Buczynski", | |
"url": "http://adambuczynski.com" | |
}, | |
"license": "UNLICENSED", |
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 delay from './delay'; // This is a const with Miliseconds | |
// This file mocks a web API by working with the hard-coded data below. | |
// It uses setTimeout to simulate the delay of an AJAX call. | |
// All calls return promises. | |
const authors = [ | |
{ | |
id: 'cory-house', | |
firstName: 'Cory', | |
lastName: 'House' |
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
class BaseComponent extends React.Component { | |
_bind(...methods) { | |
methods.forEach( (method) => this[method] = this[method].bind(this) ); | |
} | |
} | |
class ExampleComponent extends BaseComponent { | |
constructor() { | |
super(); | |
this._bind('_handleClick', '_handleFoo'); |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |