diff --git a/.gitignore b/.gitignore
index 8cdbd98..c3a72b4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -78,3 +78,8 @@ venv
# Build folder
build
+
+# Elastic Beanstalk Files
+.elasticbeanstalk/*
+!.elasticbeanstalk/*.cfg.yml
+!.elasticbeanstalk/*.global.yml
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..261b515
--- /dev/null
+++ b/index.js
@@ -0,0 +1,16 @@
+// ./index.js
+const express = require('express')
+const path = require('path')
+const port = process.env.PORT || 3000
+const app = express()
+
+// serve static assets normally
+app.use(express.static(__dirname + '/public'))
+
+// Handles all routes so you do not get a not found error
+app.get('*', function(request, response) {
+ response.sendFile(path.resolve(__dirname, 'public', 'index.html'))
+})
+
+app.listen(port)
+console.log("server started on port " + port)
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index b3c1b88..8f0146f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -14804,14 +14804,13 @@
}
},
"react": {
- "version": "16.3.0",
- "resolved": "https://registry.npmjs.org/react/-/react-16.3.0.tgz",
- "integrity": "sha512-Qh35tNbwY8SLFELkN3PCLO16EARV+lgcmNkQnoZXfzAF1ASRpeucZYUwBlBzsRAzTb7KyfBaLQ4/K/DLC6MYeA==",
+ "version": "16.13.1",
+ "resolved": "https://registry.npmjs.org/react/-/react-16.13.1.tgz",
+ "integrity": "sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==",
"requires": {
- "fbjs": "^0.8.16",
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
- "prop-types": "^15.6.0"
+ "prop-types": "^15.6.2"
}
},
"react-app-polyfill": {
diff --git a/package.json b/package.json
index 128d312..d2a1f1e 100644
--- a/package.json
+++ b/package.json
@@ -10,6 +10,7 @@
"chart.js": "^2.9.3",
"chartist": "^0.10.1",
"classnames": "^2.2.5",
+ "d3": "^5.16.0",
"d3-dsv": "^1.2.0",
"d3-format": "^1.4.4",
"d3-scale": "^3.2.1",
@@ -23,11 +24,11 @@
"npm-run-all": "^4.1.1",
"perfect-scrollbar": "^1.3.0",
"prop-types": "^15.7.2",
- "react": "^16.2.0",
+ "react": "^16.13.1",
"react-autosuggest": "^10.0.0",
"react-chartist": "^0.13.1",
"react-chartjs-2": "^2.9.0",
- "react-dom": "^16.12.0",
+ "react-dom": "^16.13.1",
"react-google-maps": "^9.4.5",
"react-router-dom": "^4.2.2",
"react-scripts": "^3.3.1",
@@ -68,6 +69,7 @@
},
"proxy": "http://localhost:5000",
"devDependencies": {
+ "@types/jest": "^26.0.0",
"env-cmd": "^10.1.0"
}
}
diff --git a/src/__tests__/Button.test.js b/src/__tests__/Button.test.js
new file mode 100644
index 0000000..7e5ab5f
--- /dev/null
+++ b/src/__tests__/Button.test.js
@@ -0,0 +1,20 @@
+import React from "react";
+import ReactDom from 'react-dom';
+import { Grid } from "material-ui";
+import {ContentCopy, LocalOffer} from "material-ui-icons";
+
+import { Button } from "components";
+
+describe("Button component", () => {
+ test('renders without crashing',()=>{
+ const div = document.createElement('div');
+ ReactDom.render(
+ ,div)
+ })
+});
\ No newline at end of file
diff --git a/src/__tests__/ChartCard.test.js b/src/__tests__/ChartCard.test.js
new file mode 100644
index 0000000..1a5e404
--- /dev/null
+++ b/src/__tests__/ChartCard.test.js
@@ -0,0 +1,41 @@
+import React from "react";
+import ReactDom from 'react-dom';
+import ChartistGraph from "react-chartist";
+import { AccessTime } from "material-ui-icons";
+
+import ChartCard from '../components/Cards/ChartCard';
+import { emailsSubscriptionChart } from "../variables/charts";
+
+
+test('renders without crashing', () => {
+ const div = document.createElement('div');
+ ReactDom.render( <
+ ChartCard classes = {
+ { "card": "chartCard" },
+ { "cardHeader": "chart" },
+ { "cardContent": "data over view" },
+ { "cardTitle": "for test" },
+ { "cardCategory": "primary" },
+ { "cardActions": "none" },
+ { "cardStats": "open" },
+ { "cardStatsIcon": "none" },
+ { "cardStatsLink": "url" }
+ }
+ chart = { <
+ ChartistGraph
+ className = "ct-chart"
+ data = { emailsSubscriptionChart.data }
+ type = "Bar"
+ options = { emailsSubscriptionChart.options }
+ responsiveOptions = { emailsSubscriptionChart.responsiveOptions }
+ listener = { emailsSubscriptionChart.animation }
+ />
+ }
+ chartColor = "orange"
+ title = "Sentiment Analysis"
+ text = "Last Year Performance"
+ statIcon = { AccessTime }
+ statText = "Updated 2 minutes ago" /
+ >
+ , div)
+})
\ No newline at end of file
diff --git a/src/__tests__/CustomInput.test.js b/src/__tests__/CustomInput.test.js
new file mode 100644
index 0000000..63b1a7e
--- /dev/null
+++ b/src/__tests__/CustomInput.test.js
@@ -0,0 +1,26 @@
+import React from "react";
+import ReactDom from 'react-dom';
+import { Grid } from "material-ui";
+import {ContentCopy, LocalOffer} from "material-ui-icons";
+
+import { CustomInput } from "components";
+
+describe("CustomInput component", () => {
+ test('renders without crashing',()=>{
+ const div = document.createElement('div');
+ ReactDom.render(
+ ,div)
+ })
+});
\ No newline at end of file
diff --git a/src/__tests__/DoughnutChart.test.js b/src/__tests__/DoughnutChart.test.js
new file mode 100644
index 0000000..8fe1d21
--- /dev/null
+++ b/src/__tests__/DoughnutChart.test.js
@@ -0,0 +1,11 @@
+import React from "react";
+import ReactDom from 'react-dom';
+
+import DoughnutChart from "../components/Charts/Doughnut";
+
+describe("DoughnutChart component", () => {
+ test('renders without crashing',()=>{
+ const div = document.createElement('div');
+ ReactDom.render(,div)
+ })
+});
\ No newline at end of file
diff --git a/src/__tests__/DoughnutChart2.test.js b/src/__tests__/DoughnutChart2.test.js
new file mode 100644
index 0000000..d8e1896
--- /dev/null
+++ b/src/__tests__/DoughnutChart2.test.js
@@ -0,0 +1,42 @@
+import React from "react";
+import ReactDom from 'react-dom';
+
+import {Doughnut, Chart} from 'react-chartjs-2';
+
+describe("DoughnutChart component", () => {
+ const div = document.createElement('div');
+ const Data = {
+ labels: ['LTCH', 'ETH', 'BTC'],
+ datasets: [
+ {
+ label: 'Portfolio',
+ data: [66000, 145000, 845000],
+ backgroundColor: ['#1b9868', '#ffd700', '#ec6d10']
+ }
+ ]
+ };
+
+ const comp = ReactDom.render(
+ {
+ try {
+ console.log(elems[0]._index);
+ } catch (error) {
+ console.log(error)
+ }
+ }}
+ />,div);
+ test('Crypto currencies shown in DoughnutChart matches with actual Crypto currencies of User',()=>{
+ expect(comp.props.data.labels).toEqual(Data.labels)
+ })
+ test('Amount of Investment shown in DoughnutChart matches with actual Investment of User',()=>{
+ expect(comp.props.data.datasets[0].data).toEqual(Data.datasets[0].data)
+ })
+ test('Colour assigned to each crypto currency is same as passed through props',()=>{
+ expect(comp.props.data.datasets[0].backgroundColor).toEqual(Data.datasets[0].backgroundColor)
+ })
+});
\ No newline at end of file
diff --git a/src/__tests__/HearderLink.test.js b/src/__tests__/HearderLink.test.js
new file mode 100644
index 0000000..05bb4f9
--- /dev/null
+++ b/src/__tests__/HearderLink.test.js
@@ -0,0 +1,15 @@
+import React from "react";
+import ReactDom from 'react-dom';
+import {Hidden} from "material-ui";
+
+import { HeaderLinks } from "components";
+
+describe("HeaderLink component", () => {
+ test('renders without crashing',()=>{
+ const div = document.createElement('div');
+ ReactDom.render(
+
+
+ ,div)
+ })
+});
\ No newline at end of file
diff --git a/src/__tests__/ItemGrid.test.js b/src/__tests__/ItemGrid.test.js
new file mode 100644
index 0000000..75653cd
--- /dev/null
+++ b/src/__tests__/ItemGrid.test.js
@@ -0,0 +1,16 @@
+import React from "react";
+import ReactDom from 'react-dom';
+
+import { ItemGrid } from "components";
+
+describe("ItemGrid component", () => {
+ test('renders without crashing',()=>{
+ const div = document.createElement('div');
+ ReactDom.render(
+
+
+
testing ItemGrid
+
+ ,div)
+ })
+});
\ No newline at end of file
diff --git a/src/__tests__/OrderPopup.test.js b/src/__tests__/OrderPopup.test.js
new file mode 100644
index 0000000..dd58055
--- /dev/null
+++ b/src/__tests__/OrderPopup.test.js
@@ -0,0 +1,17 @@
+import React from "react";
+import ReactDom from 'react-dom';
+
+import OrderPopup from "../components/Popup/OrderPopup"
+
+describe("OrderPopup component", () => {
+ test('renders without crashing',()=>{
+ const div = document.createElement('div');
+ ReactDom.render(
+ ,div)
+ })
+});
\ No newline at end of file
diff --git a/src/__tests__/RegularCard.test.js b/src/__tests__/RegularCard.test.js
new file mode 100644
index 0000000..c0b8e6d
--- /dev/null
+++ b/src/__tests__/RegularCard.test.js
@@ -0,0 +1,34 @@
+import React from "react";
+import ReactDom from 'react-dom';
+import { Grid } from "material-ui";
+
+import { RegularCard,Small,ItemGrid } from "components";
+
+describe("RegularCard component", () => {
+ test('renders without crashing',()=>{
+ const div = document.createElement('div');
+ ReactDom.render(
+
+
+
+
+ Notifications Places
+ Click to view notifications
+
+
+
+
+ }
+ footer = {
+
+
footer of the card
+
+ }
+ />,div)
+ })
+});
\ No newline at end of file
diff --git a/src/__tests__/Snackbar.test.js b/src/__tests__/Snackbar.test.js
new file mode 100644
index 0000000..3d0ed7e
--- /dev/null
+++ b/src/__tests__/Snackbar.test.js
@@ -0,0 +1,22 @@
+import React from "react";
+import ReactDom from 'react-dom';
+import {LocalOffer} from "material-ui-icons";
+
+import { Snackbar } from "components";
+
+describe("Snackbar component", () => {
+ test('renders without crashing',()=>{
+ const div = document.createElement('div');
+ ReactDom.render(
+ ,div)
+ })
+});
\ No newline at end of file
diff --git a/src/__tests__/SnackbarContent.test.js b/src/__tests__/SnackbarContent.test.js
new file mode 100644
index 0000000..fff857b
--- /dev/null
+++ b/src/__tests__/SnackbarContent.test.js
@@ -0,0 +1,20 @@
+import React from "react";
+import ReactDom from 'react-dom';
+import {LocalOffer} from "material-ui-icons";
+
+import { SnackbarContent } from "components";
+
+describe("SnackbarContent component", () => {
+ test('renders without crashing',()=>{
+ const div = document.createElement('div');
+ ReactDom.render(
+ ,div)
+ })
+});
\ No newline at end of file
diff --git a/src/__tests__/StatsCard.test.js b/src/__tests__/StatsCard.test.js
new file mode 100644
index 0000000..4962037
--- /dev/null
+++ b/src/__tests__/StatsCard.test.js
@@ -0,0 +1,22 @@
+import React from "react";
+import ReactDom from 'react-dom';
+import {ContentCopy, LocalOffer} from "material-ui-icons";
+
+import { StatsCard } from "components";
+
+describe("StatsCard component", () => {
+ test('renders without crashing',()=>{
+ const div = document.createElement('div');
+ ReactDom.render(
+ ,div)
+ })
+});
\ No newline at end of file
diff --git a/src/__tests__/Table.test.js b/src/__tests__/Table.test.js
new file mode 100644
index 0000000..9b8c5ba
--- /dev/null
+++ b/src/__tests__/Table.test.js
@@ -0,0 +1,17 @@
+import React from "react";
+import ReactDom from 'react-dom';
+
+import { Table } from "components";
+
+describe("Table component", () => {
+ test('renders without crashing',()=>{
+ const div = document.createElement('div');
+ ReactDom.render(
+ ,div)
+ })
+});
\ No newline at end of file