From 223f90491ee5397f22a06fdea1abbc7f49bc994c Mon Sep 17 00:00:00 2001 From: leticiaarj Date: Mon, 25 Mar 2019 21:27:43 -0300 Subject: [PATCH 1/5] Graph component ready using the Recharts library. app.js already configured and Recharts installed in docker. --- unbrake/package.json | 40 ++++++++++++++++++ unbrake/src/App.js | 21 ++++++++++ unbrake/src/actions/index.js | 5 +++ unbrake/src/component/Result.js | 26 ++++++++++++ unbrake/src/component/Sum.js | 49 ++++++++++++++++++++++ unbrake/src/component/realtimechat.js | 58 +++++++++++++++++++++++++++ unbrake/src/reducers/index.js | 8 ++++ unbrake/src/reducers/sum.js | 12 ++++++ 8 files changed, 219 insertions(+) create mode 100644 unbrake/package.json create mode 100644 unbrake/src/App.js create mode 100644 unbrake/src/actions/index.js create mode 100644 unbrake/src/component/Result.js create mode 100644 unbrake/src/component/Sum.js create mode 100644 unbrake/src/component/realtimechat.js create mode 100644 unbrake/src/reducers/index.js create mode 100644 unbrake/src/reducers/sum.js diff --git a/unbrake/package.json b/unbrake/package.json new file mode 100644 index 00000000..9aaf3174 --- /dev/null +++ b/unbrake/package.json @@ -0,0 +1,40 @@ +{ + "name": "unbrake", + "version": "0.1.0", + "private": true, + "dependencies": { + "@material-ui/core": "^3.9.2", + "react": "^16.8.5", + "react-dom": "^16.8.5", + "react-redux": "^6.0.1", + "react-router-dom": "^5.0.0", + "react-scripts": "2.1.8", + "redux": "^4.0.1", + "recharts": "^1.5.0" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject", + "lint": "eslint src" + }, + "eslintConfig": { + "extends": "react-app" + }, + "browserslist": [ + ">0.2%", + "not dead", + "not ie <= 11", + "not op_mini all" + ], + "devDependencies": { + "eslint-config-airbnb": "^17.1.0", + "eslint-config-prettier": "^4.1.0", + "eslint-plugin-import": "^2.16.0", + "eslint-plugin-jsx-a11y": "^6.2.1", + "eslint-plugin-prettier": "^3.0.1", + "eslint-plugin-react": "^7.12.4", + "prettier": "^1.16.4" + } +} diff --git a/unbrake/src/App.js b/unbrake/src/App.js new file mode 100644 index 00000000..893b9355 --- /dev/null +++ b/unbrake/src/App.js @@ -0,0 +1,21 @@ +import React, { Component } from 'react'; +import logo from './logo.svg'; +import './App.css'; +import Sum from './component/Sum'; +import { Provider } from 'react-redux' +import { createStore } from 'redux' +import Reducer from './reducers/index'; +import SimpleLineChart from './component/realtimechat' + + +export default class App extends React.Component { + render() { + return ( +
+ + +
+ ); + } +} + diff --git a/unbrake/src/actions/index.js b/unbrake/src/actions/index.js new file mode 100644 index 00000000..50da05a1 --- /dev/null +++ b/unbrake/src/actions/index.js @@ -0,0 +1,5 @@ +export const add = (n1, n2) => ({ + type: 'ADD', //Tipo da ação. Eu que escolho + n1, + n2 +}) \ No newline at end of file diff --git a/unbrake/src/component/Result.js b/unbrake/src/component/Result.js new file mode 100644 index 00000000..62e6e349 --- /dev/null +++ b/unbrake/src/component/Result.js @@ -0,0 +1,26 @@ +import React from 'react'; +import { connect } from 'react-redux'; + +class Result extends React.Component{ + constructor(props){ + super(props) + } + + +render(){ + return ( +

{this.props.sum}

+ ) +} +} + +const mapStateToProps = state => { + return state.sum +} + +//export default Result; +export default connect( + mapStateToProps, +)(Result) + +//export default Result; diff --git a/unbrake/src/component/Sum.js b/unbrake/src/component/Sum.js new file mode 100644 index 00000000..ae5e6150 --- /dev/null +++ b/unbrake/src/component/Sum.js @@ -0,0 +1,49 @@ +import React from 'react'; +import Result from './Result'; +import { connect } from 'react-redux'; +import {add} from '../actions' + + +class Sum extends React.Component { + constructor(props){ + super(props); + this.state = {number1: '', number2: '', sum: ''}; //state: Estado interno. Um Json. + this.handleSubmit = this.handleSubmit.bind(this); + this.handleChange = this.handleChange.bind(this); + + } + + handleChange(event) { + if(event.target.name === "number1"){ + this.setState({number1: event.target.value}); + } + else{ + this.setState({number2: event.target.value}); + } + } + + handleSubmit(event){ + this.props.dispatch(add(this.state.number1, this.state.number2)) // Mandar uma ação para algum lugar + let sum = +this.state.number1 + +this.state.number2 + this.setState({sum: sum}); + event.preventDefault(); + + } + //connect: conecta meu componente ao reducer + render() { + return ( +
+
+ + + +
+ +
) + + } +} + +export default connect()(Sum); + +//export default Sum diff --git a/unbrake/src/component/realtimechat.js b/unbrake/src/component/realtimechat.js new file mode 100644 index 00000000..2e97e794 --- /dev/null +++ b/unbrake/src/component/realtimechat.js @@ -0,0 +1,58 @@ +import React, { PureComponent } from 'react'; +import { + LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, +} from 'recharts'; + +const data = [ + { + A:500, V: 1000, F: 2000, amt: 3000, //Ponto A + }, + { + A:600, V: 2000, F: 100, amt: 200, + }, + { + A:400, V: 2000, F: 9800, amt: 2290, + }, + /**{ + cd:400, uv: 2780, pv: 3908, amt: 2000, Outros pontos + }, + { + name: 'Page E', uv: 1890, pv: 4800, amt: 2181, + }, + { + name: 'Page F', uv: 2390, pv: 3800, amt: 2500, + }, + { + name: 'Page G', uv: 3490, pv: 4300, amt: 2100, + },*/ +]; + +export default class Example extends PureComponent { + static jsfiddleUrl = 'https://jsfiddle.net/alidingling/xqjtetw0/'; + + render() { + return ( + + + + + + + + + + + + + + + ); + } +} diff --git a/unbrake/src/reducers/index.js b/unbrake/src/reducers/index.js new file mode 100644 index 00000000..dece1893 --- /dev/null +++ b/unbrake/src/reducers/index.js @@ -0,0 +1,8 @@ +import { combineReducers } from 'redux' +import sum from './sum' + +const Reducer = combineReducers({ //Agrupa os componentes + sum, +}) + +export default Reducer; \ No newline at end of file diff --git a/unbrake/src/reducers/sum.js b/unbrake/src/reducers/sum.js new file mode 100644 index 00000000..a5efffaf --- /dev/null +++ b/unbrake/src/reducers/sum.js @@ -0,0 +1,12 @@ +const sum = (state = {}, action) => { //Jeito de definir uma função + switch (action.type) { + case 'ADD': + console.log(state, action) + return {...state, sum: +action.n1 + +action.n2}; + + default: + return state + } +} + +export default sum From f58bca4b73c4740c117ab9cfcbfa9ca20e297835 Mon Sep 17 00:00:00 2001 From: leticiaarj Date: Wed, 27 Mar 2019 14:48:25 -0300 Subject: [PATCH 2/5] FINISH Real Time Chart --- unbrake/src/App.js | 34 ++++++++++++--- unbrake/src/actions/index.js | 5 --- unbrake/src/component/RealTimeChart.js | 32 ++++++++++++++ unbrake/src/component/Result.js | 26 ------------ unbrake/src/component/Sum.js | 49 ---------------------- unbrake/src/component/realtimechat.js | 58 -------------------------- unbrake/src/reducers/index.js | 8 ---- unbrake/src/reducers/sum.js | 12 ------ 8 files changed, 60 insertions(+), 164 deletions(-) delete mode 100644 unbrake/src/actions/index.js create mode 100644 unbrake/src/component/RealTimeChart.js delete mode 100644 unbrake/src/component/Result.js delete mode 100644 unbrake/src/component/Sum.js delete mode 100644 unbrake/src/component/realtimechat.js delete mode 100644 unbrake/src/reducers/index.js delete mode 100644 unbrake/src/reducers/sum.js diff --git a/unbrake/src/App.js b/unbrake/src/App.js index 893b9355..d35373ab 100644 --- a/unbrake/src/App.js +++ b/unbrake/src/App.js @@ -1,21 +1,43 @@ import React, { Component } from 'react'; import logo from './logo.svg'; import './App.css'; -import Sum from './component/Sum'; -import { Provider } from 'react-redux' -import { createStore } from 'redux' -import Reducer from './reducers/index'; -import SimpleLineChart from './component/realtimechat' +import RealTimeChart from './component/RealTimeChart' +const data = [ + + { + Forca:1000, Velocidade: 3000, amt: 3000, //Ponto 1 + }, + { + Forca:2000, Velocidade: 2000, amt: 200, + }, + { + Forca:3000, Velocidade: 1000, amt: 2290, + }, + /**{ + cd:400, uv: 2780, pv: 3908, amt: 2000, Outros pontos + }, + { + name: 'Page E', uv: 1890, pv: 4800, amt: 2181, + }, + { + name: 'Page F', uv: 2390, pv: 3800, amt: 2500, + }, + { + name: 'Page G', uv: 3490, pv: 4300, amt: 2100, + },*/ +]; + export default class App extends React.Component { render() { return (
- +
); } } + diff --git a/unbrake/src/actions/index.js b/unbrake/src/actions/index.js deleted file mode 100644 index 50da05a1..00000000 --- a/unbrake/src/actions/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export const add = (n1, n2) => ({ - type: 'ADD', //Tipo da ação. Eu que escolho - n1, - n2 -}) \ No newline at end of file diff --git a/unbrake/src/component/RealTimeChart.js b/unbrake/src/component/RealTimeChart.js new file mode 100644 index 00000000..ba9acb17 --- /dev/null +++ b/unbrake/src/component/RealTimeChart.js @@ -0,0 +1,32 @@ +import React, { PureComponent } from 'react'; +import { + LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, +} from 'recharts'; + + +export default class RealTimeChart extends React.Component { + + render() { + return ( + + + + + + + + + + + + + ); + } +} diff --git a/unbrake/src/component/Result.js b/unbrake/src/component/Result.js deleted file mode 100644 index 62e6e349..00000000 --- a/unbrake/src/component/Result.js +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react'; -import { connect } from 'react-redux'; - -class Result extends React.Component{ - constructor(props){ - super(props) - } - - -render(){ - return ( -

{this.props.sum}

- ) -} -} - -const mapStateToProps = state => { - return state.sum -} - -//export default Result; -export default connect( - mapStateToProps, -)(Result) - -//export default Result; diff --git a/unbrake/src/component/Sum.js b/unbrake/src/component/Sum.js deleted file mode 100644 index ae5e6150..00000000 --- a/unbrake/src/component/Sum.js +++ /dev/null @@ -1,49 +0,0 @@ -import React from 'react'; -import Result from './Result'; -import { connect } from 'react-redux'; -import {add} from '../actions' - - -class Sum extends React.Component { - constructor(props){ - super(props); - this.state = {number1: '', number2: '', sum: ''}; //state: Estado interno. Um Json. - this.handleSubmit = this.handleSubmit.bind(this); - this.handleChange = this.handleChange.bind(this); - - } - - handleChange(event) { - if(event.target.name === "number1"){ - this.setState({number1: event.target.value}); - } - else{ - this.setState({number2: event.target.value}); - } - } - - handleSubmit(event){ - this.props.dispatch(add(this.state.number1, this.state.number2)) // Mandar uma ação para algum lugar - let sum = +this.state.number1 + +this.state.number2 - this.setState({sum: sum}); - event.preventDefault(); - - } - //connect: conecta meu componente ao reducer - render() { - return ( -
-
- - - -
- -
) - - } -} - -export default connect()(Sum); - -//export default Sum diff --git a/unbrake/src/component/realtimechat.js b/unbrake/src/component/realtimechat.js deleted file mode 100644 index 2e97e794..00000000 --- a/unbrake/src/component/realtimechat.js +++ /dev/null @@ -1,58 +0,0 @@ -import React, { PureComponent } from 'react'; -import { - LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, -} from 'recharts'; - -const data = [ - { - A:500, V: 1000, F: 2000, amt: 3000, //Ponto A - }, - { - A:600, V: 2000, F: 100, amt: 200, - }, - { - A:400, V: 2000, F: 9800, amt: 2290, - }, - /**{ - cd:400, uv: 2780, pv: 3908, amt: 2000, Outros pontos - }, - { - name: 'Page E', uv: 1890, pv: 4800, amt: 2181, - }, - { - name: 'Page F', uv: 2390, pv: 3800, amt: 2500, - }, - { - name: 'Page G', uv: 3490, pv: 4300, amt: 2100, - },*/ -]; - -export default class Example extends PureComponent { - static jsfiddleUrl = 'https://jsfiddle.net/alidingling/xqjtetw0/'; - - render() { - return ( - - - - - - - - - - - - - - - ); - } -} diff --git a/unbrake/src/reducers/index.js b/unbrake/src/reducers/index.js deleted file mode 100644 index dece1893..00000000 --- a/unbrake/src/reducers/index.js +++ /dev/null @@ -1,8 +0,0 @@ -import { combineReducers } from 'redux' -import sum from './sum' - -const Reducer = combineReducers({ //Agrupa os componentes - sum, -}) - -export default Reducer; \ No newline at end of file diff --git a/unbrake/src/reducers/sum.js b/unbrake/src/reducers/sum.js deleted file mode 100644 index a5efffaf..00000000 --- a/unbrake/src/reducers/sum.js +++ /dev/null @@ -1,12 +0,0 @@ -const sum = (state = {}, action) => { //Jeito de definir uma função - switch (action.type) { - case 'ADD': - console.log(state, action) - return {...state, sum: +action.n1 + +action.n2}; - - default: - return state - } -} - -export default sum From 5ea026f7490bc83bc8eb8a1b17705b67ff45320e Mon Sep 17 00:00:00 2001 From: Felipe Borges Date: Thu, 28 Mar 2019 03:40:47 -0300 Subject: [PATCH 3/5] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 41 +++++++++++-------- .github/ISSUE_TEMPLATE/template-de-tarefas.md | 22 ++++++++++ 2 files changed, 45 insertions(+), 18 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/template-de-tarefas.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 961c7bd5..80d4f2c2 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,31 +1,36 @@ --- name: Bug report -about: Create a report to help us improve +about: Reporte um bug ou nos ajude a resolver algum title: '' labels: bug assignees: '' --- -## Describe the bug -A clear and concise description of what the bug is. +## Descrição do problema -## Steps to Reproduce -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error +Um descrição clara e concisa sobre o problema -## Behavior -### Actual Behavior -What is happening when you execute the steps? +## Passos para reprodução -### Expected Behavior -A clear and concise description of what you expected to happen. +Passos para reproduzir o comportamento. -## Additional context and screenshots -If applicable, add screenshots and other details to help explain your problem. +1. Vá para... +2. Click em... +... -## Possible Fix -If you have any idea of what can be done to solve the problem, write it here. +### Comportamento atual + +O que está acontecendo atualmente + +### Comportamento esperado + +Qual é o comportamento esperado pelo sistema + +## Contextos, prints e informações adicionais + +Se for aplicável, adicione gifs, imagens ou qualquer outro detalhe de enriqueça a descrição do problema. + +## Possível Solução + +Caso você tenha algum sugestão de onde começar a procurar o problema ou uma solução para ele escreva aqui. diff --git a/.github/ISSUE_TEMPLATE/template-de-tarefas.md b/.github/ISSUE_TEMPLATE/template-de-tarefas.md new file mode 100644 index 00000000..b65a60cc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/template-de-tarefas.md @@ -0,0 +1,22 @@ +--- +name: Template de tarefas +about: Template para definir a tarefa para algum membro +title: '' +labels: '' +assignees: '' + +--- + +## Descrição + +Descreva a tarefa aqui + +## Tarefas + +- [ ] Primeira tarefa +- [ ] Segunda tarefa +- [ ] ... + +## Informação adicional + +Dê mais informação sobre a tarefa (sites, imagens, ideias, qualquer coisa que possa ser útil para quem estiver trabalhando) From bc01d397750e151d043dc437ba5767becd8f4dbf Mon Sep 17 00:00:00 2001 From: leticiaarj Date: Sun, 31 Mar 2019 14:34:29 -0300 Subject: [PATCH 4/5] =?UTF-8?q?C=C3=B3digos=20sem=20erros?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unbrake-frontend/package.json | 2 + unbrake-frontend/src/App.jsx | 58 ++++++++----- .../src/components/RealTimeChart.jsx | 83 +++++++++++++++++++ unbrake/package.json | 40 --------- unbrake/src/App.js | 43 ---------- unbrake/src/component/RealTimeChart.js | 32 ------- 6 files changed, 124 insertions(+), 134 deletions(-) create mode 100644 unbrake-frontend/src/components/RealTimeChart.jsx delete mode 100644 unbrake/package.json delete mode 100644 unbrake/src/App.js delete mode 100644 unbrake/src/component/RealTimeChart.js diff --git a/unbrake-frontend/package.json b/unbrake-frontend/package.json index b0b7d7ef..12bebf4c 100644 --- a/unbrake-frontend/package.json +++ b/unbrake-frontend/package.json @@ -10,6 +10,8 @@ "react-redux": "^6.0.1", "react-router-dom": "^5.0.0", "react-scripts": "2.1.8", + "recharts": "^1.5.0", + "prop-types": "^15.7.2", "redux": "^4.0.1" }, "scripts": { diff --git a/unbrake-frontend/src/App.jsx b/unbrake-frontend/src/App.jsx index 53247c3e..d32ecb17 100644 --- a/unbrake-frontend/src/App.jsx +++ b/unbrake-frontend/src/App.jsx @@ -1,27 +1,47 @@ import React from "react"; -import logo from "./logo.svg"; import "./App.css"; +import RealTimeChart from "./components/RealTimeChart"; +const data = [ + { + Frenagem: 500, + Velocidade: 3000, + amt: 3000 // Ponto 1 + }, + { + Frenagem: 2000, + Velocidade: 2000, + amt: 200 + }, + { + Frenagem: 3000, + Velocidade: 1000, + amt: 2290 + } + /** + *{ + * cd:400, uv: 2780, pv: 3908, amt: 2000, Outros pontos + * }, + * { + * name: 'Page E', uv: 1890, pv: 4800, amt: 2181, + * }, + * { + * name: 'Page F', uv: 2390, pv: 3800, amt: 2500, + * }, + * { + * name: 'Page G', uv: 3490, pv: 4300, amt: 2100, + *}, + */ +]; const App = () => { return ( -
-
- logo -

- Edit - src/App.jsx - and save to reload. -

- - Learn React - -
-
+ ); }; diff --git a/unbrake-frontend/src/components/RealTimeChart.jsx b/unbrake-frontend/src/components/RealTimeChart.jsx new file mode 100644 index 00000000..a1a0c1a0 --- /dev/null +++ b/unbrake-frontend/src/components/RealTimeChart.jsx @@ -0,0 +1,83 @@ +import React from "react"; +import PropTypes from "prop-types"; + +import { + LineChart, + Line, + XAxis, + YAxis, + CartesianGrid, + Tooltip, + Legend +} from "recharts"; + +class RealTimeChart extends React.PureComponent { + render() { + const { data, X, Y, Label1, Label2 } = this.props; + return ( + + + + + + + + + + ); + } +} +RealTimeChart.propTypes = { + data: PropTypes.instanceOf(Array), + X: PropTypes.string, + Y: PropTypes.string, + Label1: PropTypes.string, + Label2: PropTypes.string +}; +RealTimeChart.defaultProps = { + data: [ + { + Frenagem: 500, + Velocidade: 3000, + amt: 3000 // Ponto 1 + }, + { + Frenagem: 2000, + Velocidade: 2000, + amt: 200 + }, + { + Frenagem: 3000, + Velocidade: 1000, + amt: 2290 + } + ], + X: "Eixo X", + Y: "Eixo Y", + Label1: "Frenagem", + Label2: "Velocidade" +}; + +export default RealTimeChart; diff --git a/unbrake/package.json b/unbrake/package.json deleted file mode 100644 index 9aaf3174..00000000 --- a/unbrake/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "unbrake", - "version": "0.1.0", - "private": true, - "dependencies": { - "@material-ui/core": "^3.9.2", - "react": "^16.8.5", - "react-dom": "^16.8.5", - "react-redux": "^6.0.1", - "react-router-dom": "^5.0.0", - "react-scripts": "2.1.8", - "redux": "^4.0.1", - "recharts": "^1.5.0" - }, - "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject", - "lint": "eslint src" - }, - "eslintConfig": { - "extends": "react-app" - }, - "browserslist": [ - ">0.2%", - "not dead", - "not ie <= 11", - "not op_mini all" - ], - "devDependencies": { - "eslint-config-airbnb": "^17.1.0", - "eslint-config-prettier": "^4.1.0", - "eslint-plugin-import": "^2.16.0", - "eslint-plugin-jsx-a11y": "^6.2.1", - "eslint-plugin-prettier": "^3.0.1", - "eslint-plugin-react": "^7.12.4", - "prettier": "^1.16.4" - } -} diff --git a/unbrake/src/App.js b/unbrake/src/App.js deleted file mode 100644 index d35373ab..00000000 --- a/unbrake/src/App.js +++ /dev/null @@ -1,43 +0,0 @@ -import React, { Component } from 'react'; -import logo from './logo.svg'; -import './App.css'; -import RealTimeChart from './component/RealTimeChart' - - -const data = [ - - { - Forca:1000, Velocidade: 3000, amt: 3000, //Ponto 1 - }, - { - Forca:2000, Velocidade: 2000, amt: 200, - }, - { - Forca:3000, Velocidade: 1000, amt: 2290, - }, - /**{ - cd:400, uv: 2780, pv: 3908, amt: 2000, Outros pontos - }, - { - name: 'Page E', uv: 1890, pv: 4800, amt: 2181, - }, - { - name: 'Page F', uv: 2390, pv: 3800, amt: 2500, - }, - { - name: 'Page G', uv: 3490, pv: 4300, amt: 2100, - },*/ -]; - -export default class App extends React.Component { - render() { - return ( -
- - -
- ); - } -} - - diff --git a/unbrake/src/component/RealTimeChart.js b/unbrake/src/component/RealTimeChart.js deleted file mode 100644 index ba9acb17..00000000 --- a/unbrake/src/component/RealTimeChart.js +++ /dev/null @@ -1,32 +0,0 @@ -import React, { PureComponent } from 'react'; -import { - LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, -} from 'recharts'; - - -export default class RealTimeChart extends React.Component { - - render() { - return ( - - - - - - - - - - - - - ); - } -} From e27595dd5c2e4774d08ddda61d0a483ca3739860 Mon Sep 17 00:00:00 2001 From: leticiaarj Date: Mon, 1 Apr 2019 16:59:15 -0300 Subject: [PATCH 5/5] Add unit test --- .../src/tests/RealTimeChart.test.jsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 unbrake-frontend/src/tests/RealTimeChart.test.jsx diff --git a/unbrake-frontend/src/tests/RealTimeChart.test.jsx b/unbrake-frontend/src/tests/RealTimeChart.test.jsx new file mode 100644 index 00000000..d449ac11 --- /dev/null +++ b/unbrake-frontend/src/tests/RealTimeChart.test.jsx @@ -0,0 +1,18 @@ +import React from "react"; +import Enzyme, { shallow } from "enzyme"; +import toJson from "enzyme-to-json"; +import Adapter from "enzyme-adapter-react-16"; +import RealTimeChart from "../components/RealTimeChart"; + +Enzyme.configure({ adapter: new Adapter() }); + +describe("", () => { + describe("render()", () => { + test("renders the component", () => { + const wrapper = shallow(); + const component = wrapper.dive(); + + expect(toJson(component)).toMatchSnapshot(); + }); + }); +});