View index.spec.js
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 styled from 'styled-components' | |
import renderer from 'react-test-renderer' | |
import { shallow, mount } from 'enzyme' | |
import { render } from 'react-testing-library' | |
const Button = styled.button` | |
color: red; | |
` |
View App.jsx
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 { Action, withStatechart } from 'react-automata' | |
const statechart = { | |
initial: 'idle', | |
states: { | |
idle: { | |
on: { | |
FETCH: 'fetching', | |
}, |
View toBeShallowInstanceOf.spec.js
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
expect.extend({ | |
toBeShallowInstanceOf(received, argument) { | |
const pass = Object.getPrototypeOf(received) === argument.prototype | |
return { | |
message: () => (pass ? 'OK' : 'KO'), | |
pass, | |
} | |
}, | |
}) |
View demo.js
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
const coords = { | |
lat: 51.5258541, | |
lng: -0.08040660000006028, | |
}; | |
class App extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { |
View demo.js
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 ReactDOM from 'react-dom'; | |
import { Gmaps, Marker } from 'react-gmaps'; | |
const coords = { | |
lat: 51.5258541, | |
lng: -0.08040660000006028, | |
}; | |
const App = React.createClass({ |
View demo.js
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 ReactDOM from 'react-dom'; | |
import { Gmaps } from 'react-gmaps'; | |
const App = React.createClass({ | |
getInitialState() { | |
return { | |
loaded: false, | |
}; |
View demo.js
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 ReactDOM from 'react-dom'; | |
import { Gmaps } from 'react-gmaps'; | |
const App = React.createClass({ | |
onMapCreated(map) { | |
const flightPlanCoordinates = [ | |
{ lat: 37.772, lng: -122.214 }, | |
{ lat: 21.291, lng: -157.821 }, |
View decribe.js
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, { PropTypes } from 'react' | |
const Describe = ({ title, children }) => ( | |
<div> | |
<h1>{title}</h1> | |
<ul>{children}</ul> | |
</div> | |
) | |
Describe.propTypes = { |
View demo.js
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 ReactDOM from 'react-dom'; | |
import { Gmaps } from 'react-gmaps'; | |
const App = React.createClass({ | |
handleZoomChanged() { | |
console.log('zoom:', this.refs.Gmaps.getMap().getZoom()); | |
}, |
NewerOlder