Skip to content

Instantly share code, notes, and snippets.

View ozovalihasan's full-sized avatar
👋
Available for chat

Hasan Özovalı ozovalihasan

👋
Available for chat
View GitHub Profile
@agiveygives
agiveygives / FunctionalComponent.jsx
Created April 25, 2019 01:34
Testing React State with Hooks, Jest, and Enzyme
import React from 'react';
const TestComponent = () => {
const [count, setCount] = React.useState(0);
return (
<h3>{count}</h3>
<span>
<button id="count-up" type="button" onClick={() => setCount(count + 1)}>Count Up</button>
<button id="count-down" type="button" onClick={() => setCount(count - 1)}>Count Down</button>