Skip to content

Commit c74e9d7

Browse files
authored
Merge pull request #236 from oslabs-beta/main
Merge from OS Labs Beta
2 parents 27b4bce + 0176dd8 commit c74e9d7

36 files changed

+2721
-1414
lines changed
File renamed without changes.

package.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,17 @@
3838
},
3939
"contributors": [
4040
"Abaas Khorrami",
41+
"Ali Rahman",
4142
"Andy Wong",
4243
"Bryan Lee",
4344
"Becca Viner",
4445
"Caitlin Chan",
46+
"Caner Demir",
4547
"Carlos Perez",
48+
"Cole Styron",
4649
"Chris Flannery",
4750
"David Chai",
51+
"Dennis Lopez",
4852
"Edwin Menendez",
4953
"Ergi Shehu",
5054
"Gabriela Jardim Aquino",
@@ -55,6 +59,7 @@
5559
"Josh Kim",
5660
"Joshua Howard",
5761
"Kevin Fey",
62+
"Kevin Ngo",
5863
"Kim Mai Nguyen",
5964
"Nathanael Wa Mwenze",
6065
"Prasanna Malla",
@@ -74,6 +79,8 @@
7479
"@babel/plugin-proposal-decorators": "^7.10.5",
7580
"@babel/preset-env": "^7.12.7",
7681
"@babel/preset-react": "^7.12.7",
82+
"@testing-library/jest-dom": "^4.2.4",
83+
"@types/chai": "^4.2.14",
7784
"@types/chrome": "^0.0.119",
7885
"@types/d3-scale-chromatic": "^2.0.0",
7986
"@types/jest": "^26.0.4",
@@ -85,7 +92,7 @@
8592
"core-js": "^3.6.5",
8693
"css-loader": "^3.6.0",
8794
"enzyme": "^3.11.0",
88-
"enzyme-adapter-react-16": "^1.15.2",
95+
"enzyme-adapter-react-16": "^1.15.6",
8996
"eslint": "^6.8.0",
9097
"eslint-config-airbnb": "^18.2.0",
9198
"eslint-plugin-import": "^2.22.0",
@@ -99,13 +106,15 @@
99106
"jest-diff": "^26.1.0",
100107
"jest-puppeteer": "^4.4.0",
101108
"jest-runner-eslint": "^0.7.7",
109+
"jscharting-react": "^1.2.1",
102110
"puppeteer": "^5.1.0",
103111
"sass": "^1.26.10",
104112
"sass-loader": "^7.3.1",
105113
"sinon-chrome": "^3.0.1",
106114
"style-loader": "^0.23.1",
107115
"ts-jest": "^26.1.2",
108116
"ts-loader": "^7.0.5",
117+
"ts-node": "^9.1.1",
109118
"typedoc": "^0.17.8",
110119
"typedoc-webpack-plugin": "^1.1.4",
111120
"typescript": "^3.9.6",
@@ -138,25 +147,31 @@
138147
"@visx/zoom": "^1.0.0",
139148
"acorn": "^7.3.1",
140149
"acorn-jsx": "^5.2.0",
150+
"apexcharts": "^3.23.1",
151+
"chai": "^4.2.0",
141152
"cookie": "^0.4.1",
142153
"d3": "^5.16.0",
143154
"d3-scale-chromatic": "^2.0.0",
144155
"d3-shape": "^2.0.0",
145156
"d3-zoom": "^1.8.3",
146157
"immer": "^3.3.0",
147158
"jest-runner": "^26.1.0",
159+
"jscharting": "^3.0.2",
148160
"jsondiffpatch": "^0.3.11",
149161
"mixpanel": "^0.11.0",
150162
"mixpanel-browser": "^2.39.0",
151163
"prop-types": "^15.7.2",
152164
"rc-slider": "^8.7.1",
153165
"rc-tooltip": "^3.7.3",
154166
"react": "^16.13.1",
167+
"react-apexcharts": "^1.3.7",
155168
"react-dom": "^16.13.1",
169+
"react-hover": "^2.0.0",
156170
"react-html-parser": "^2.0.2",
157171
"react-json-tree": "^0.11.2",
158172
"react-router-dom": "^5.2.0",
159173
"react-select": "^3.1.0",
160-
"recoil": "0.0.10"
174+
"recoil": "0.0.10",
175+
"web-vitals": "^1.1.0"
161176
}
162177
}

src/app/__tests__/ActionContainer.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,11 @@ useStoreContext.mockImplementation(() => [state, dispatch]);
8282

8383
let wrapper;
8484

85+
//actionView={true} must be passed in to <ActionContainer /> in beforeEach() to deal with new
86+
//conditional rendering in ActionContainer that shows/hides time-travel functionality
87+
8588
beforeEach(() => {
86-
wrapper = shallow(<ActionContainer />);
89+
wrapper = shallow(<ActionContainer actionView={true}/>);
8790
useStoreContext.mockClear();
8891
dispatch.mockClear();
8992
});

src/app/__tests__/MainContainer.test.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import Adapter from 'enzyme-adapter-react-16';
88
import MainContainer from '../containers/MainContainer';
99
import { useStoreContext } from '../store';
1010

11-
import HeadContainer from '../containers/HeadContainer';
1211
import ActionContainer from '../containers/ActionContainer';
1312
import StateContainer from '../containers/StateContainer';
1413
import TravelContainer from '../containers/TravelContainer';
@@ -50,7 +49,6 @@ describe('MainContainer rendering', () => {
5049
expect(wrapper.text()).toEqual(
5150
'No React application found. Please visit reactime.io to more info.If you are using a React application, make sure tha you application is running in development mode.NOTE: The React Developer Tools extension is also required for Reactime to run, if you do not already have it installed on your browser.',
5251
);
53-
expect(wrapper.find(HeadContainer).length).toBe(0);
5452
expect(wrapper.find(ActionContainer).length).toBe(0);
5553
expect(wrapper.find(StateContainer).length).toBe(0);
5654
expect(wrapper.find(TravelContainer).length).toBe(0);
@@ -66,7 +64,6 @@ describe('MainContainer rendering', () => {
6664
};
6765

6866
wrapper = shallow(<MainContainer />);
69-
expect(wrapper.find(HeadContainer).length).toBe(1);
7067
expect(wrapper.find(ActionContainer).length).toBe(1);
7168
expect(wrapper.find(StateContainer).length).toBe(1);
7269
expect(wrapper.find(TravelContainer).length).toBe(1);

src/app/__tests__/WebMetrics.test.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* eslint:disable */
2+
import React from 'react';
3+
import { shallow, configure } from 'enzyme';
4+
import Adapter from 'enzyme-adapter-react-16';
5+
import WebMetrics from '../components/WebMetrics';
6+
import { expect } from 'chai';
7+
8+
9+
//the WebMetrics container should render 4 <div/> elements, each with id="card"
10+
//the WebMetrics container is itself <div class="web-metrics-container" />
11+
configure({ adapter: new (Adapter as any)() });
12+
13+
let wrapper = shallow(<WebMetrics />);
14+
15+
16+
describe('WebMetrics graph testing', ()=> {
17+
it ('should have 1 div with class name "metric" ', () => {
18+
expect(wrapper.find('.metric')).to.have.lengthOf(1);
19+
})
20+
21+
it ('should have 1 div with id "chart" ', () => {
22+
expect(wrapper.find('#chart')).to.have.lengthOf(1);
23+
})
24+
25+
26+
})
27+

src/app/actions/actions.ts

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
22
import * as types from '../constants/actionTypes';
33

4-
export const toggleMode = mode => ({
4+
export const save = (tabsObj) => ({
5+
type: types.SAVE,
6+
payload: tabsObj,
7+
});
8+
export const deleteSeries = () =>({
9+
type: types.DELETE_SERIES,
10+
})
11+
export const toggleMode = (mode) => ({
512
type: types.TOGGLE_MODE,
613
payload: mode,
714
});
815

9-
export const addNewSnapshots = tabsObj => ({
16+
export const addNewSnapshots = (tabsObj) => ({
1017
type: types.NEW_SNAPSHOTS,
1118
payload: tabsObj,
1219
});
1320

14-
export const initialConnect = tabsObj => ({
21+
export const initialConnect = (tabsObj) => ({
1522
type: types.INITIAL_CONNECT,
1623
payload: tabsObj,
1724
});
1825

19-
export const setPort = port => ({
26+
export const setPort = (port) => ({
2027
type: types.SET_PORT,
2128
payload: port,
2229
});
@@ -25,12 +32,12 @@ export const emptySnapshots = () => ({
2532
type: types.EMPTY,
2633
});
2734

28-
export const changeView = index => ({
35+
export const changeView = (index) => ({
2936
type: types.CHANGE_VIEW,
3037
payload: index,
3138
});
3239

33-
export const changeSlider = index => ({
40+
export const changeSlider = (index) => ({
3441
type: types.CHANGE_SLIDER,
3542
payload: index,
3643
});
@@ -54,22 +61,22 @@ export const pause = () => ({
5461
type: types.PAUSE,
5562
});
5663

57-
export const startPlaying = intervalId => ({
64+
export const startPlaying = (intervalId) => ({
5865
type: types.PLAY,
5966
payload: intervalId,
6067
});
6168

62-
export const importSnapshots = newSnaps => ({
69+
export const importSnapshots = (newSnaps) => ({
6370
type: types.IMPORT,
6471
payload: newSnaps,
6572
});
6673

67-
export const setTab = tab => ({
74+
export const setTab = (tab) => ({
6875
type: types.SET_TAB,
6976
payload: tab,
7077
});
7178

72-
export const deleteTab = tab => ({
79+
export const deleteTab = (tab) => ({
7380
type: types.DELETE_TAB,
7481
payload: tab,
7582
});
@@ -79,12 +86,12 @@ export const resetSlider = () => ({
7986
});
8087

8188
export const onHover = (rtid) => ({
82-
type: types.ON_HOVER,
89+
type: types.ON_HOVER,
8390
//the payload should be something to relate the component we're hovering and highlight that component on the DOM
84-
payload: rtid
85-
})
91+
payload: rtid,
92+
});
8693

8794
export const onHoverExit = (rtid) => ({
8895
type: types.ON_HOVER_EXIT,
89-
payload: rtid
90-
})
96+
payload: rtid,
97+
});

0 commit comments

Comments
 (0)