Skip to content

Commit dce6d36

Browse files
authored
Merge pull request #194 from open-source-labs/staging
Merge from staging
2 parents aafe919 + 92e62b9 commit dce6d36

File tree

21 files changed

+18351
-102
lines changed

21 files changed

+18351
-102
lines changed

package-lock.json

Lines changed: 18318 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/__tests__/MainSlider.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
/* eslint-disable react/jsx-props-no-spreading */
23
import { shallow, configure } from 'enzyme';
34
import React from 'react';
@@ -8,7 +9,7 @@ import MainSlider from '../components/MainSlider';
89

910
import { useStoreContext } from '../store';
1011

11-
configure({ adapter: new Adapter() });
12+
configure({ adapter: new (Adapter as any)() });
1213

1314
jest.mock('../store');
1415
// the handle function in MainSlider returns out a Tooltip Component

src/app/__tests__/PerfView.test.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
/* eslint-disable max-len */
2+
/* eslint-disable @typescript-eslint/no-explicit-any */
3+
/* eslint-disable @typescript-eslint/no-var-requires */
14
import React from 'react';
25
import { configure, shallow } from 'enzyme';
36
// import { act } from 'react-dom/test-utils';
47
import Adapter from 'enzyme-adapter-react-16';
5-
const PerfView = require('../components/PerfView').default
8+
9+
const PerfView = require('../components/PerfView').default;
610
// import { iterator } from 'core-js/fn/symbol';
711

812
// Unit test cases for PerfView
@@ -103,10 +107,10 @@ describe('PerfView Component ', () => {
103107

104108
const props = {
105109
viewIndex: -1,
106-
snapshots: snapshots,
110+
snapshots,
107111
width: 600,
108112
height: 600,
109-
}
113+
};
110114

111115
beforeEach(() => {
112116
wrapper = shallow(<PerfView viewIndex={props.viewIndex} snapshots={props.snapshots} width={props.width} height={props.height} />);

src/app/__tests__/SwitchApp.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
import React from 'react';
23
import Select from 'react-select';
34
import { configure, shallow } from 'enzyme';
@@ -6,7 +7,7 @@ import SwitchApp from '../components/SwitchApp';
67

78
import { useStoreContext } from '../store';
89

9-
configure({ adapter: new Adapter() });
10+
configure({ adapter: new (Adapter as any)() });
1011

1112
jest.mock('../store');
1213

src/app/__tests__/TravelContainer.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
/* eslint-disable react/jsx-filename-extension */
23
import { shallow, configure } from 'enzyme';
34
import React from 'react';
@@ -8,7 +9,7 @@ import Dropdown from '../components/Dropdown';
89
import { useStoreContext } from '../store';
910
import { moveBackward, moveForward } from '../actions/actions';
1011

11-
configure({ adapter: new Adapter() });
12+
configure({ adapter: new (Adapter as any)() });
1213

1314
const state = {
1415
tabs: {

src/app/components/Diff.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ function Diff(props: DiffProps) {
7373
else formatters.html.hideUnchanged();
7474

7575
if (previous === undefined || delta === undefined) {
76-
// console.log('reacthtml parser -->', ReactHtmlParser(html), typeof ReactHtmlParser(html));
7776
return <div className="no-data-message"> No state change detected. Trigger an event to change state </div>;
7877
}
7978
return <div>{ReactHtmlParser(html)}</div>;

src/app/components/PerfView.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,11 @@ const PerfView = (props:PerfViewProps) => {
7272
}, [indexToDisplay, svgRef]);
7373

7474
useEffect(() => {
75-
// console.log(`***** useEffect - MAIN -> snapshots[${indexToDisplay}]`, snapshots[indexToDisplay]);
76-
7775
// Error, no App-level component present
7876
if (snapshots[indexToDisplay].children.length < 1) return;
7977

8078
// Generate tree with our data
8179
const packedRoot = packFunc(snapshots[indexToDisplay]);
82-
// console.log('PerfView -> packedRoot', packedRoot);
83-
8480
// Set initial focus to root node
8581
let curFocus = packedRoot;
8682

@@ -112,7 +108,6 @@ const PerfView = (props:PerfViewProps) => {
112108
.style('fill-opacity', (d:{parent:object}) => (d.parent === packedRoot ? 1 : 0))
113109
.style('display', (d:{parent?:object}) => (d.parent === packedRoot ? 'inline' : 'none'))
114110
.text((d:{data:{name:string, componentData?:{actualDuration:any}}}) => {
115-
// console.log("PerfView -> d.data", d.data);
116111
if (!d.data.componentData.actualDuration) handleNoRenderData(true);
117112
else handleNoRenderData(false);
118113
return `${d.data.name}: ${Number.parseFloat(d.data.componentData.actualDuration || 0).toFixed(2)}ms`;

src/app/reducers/mainReducer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable no-restricted-syntax */
2+
/* eslint-disable prefer-const */
13
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
24
/* eslint-disable no-param-reassign */
35
import produce from 'immer';
@@ -24,14 +26,12 @@ export default (state, action) => produce(state, draft => {
2426
}
2527

2628
const objChildArray = [];
27-
// eslint-disable-next-line no-restricted-syntax
2829
if (obj) {
29-
for (const objChild of obj.children) {
30+
for (let objChild of obj.children) {
3031
objChildArray.push(findName(index, objChild));
3132
}
3233
}
33-
// eslint-disable-next-line no-restricted-syntax
34-
for (const objChildName of objChildArray) {
34+
for (let objChildName of objChildArray) {
3535
if (objChildName) {
3636
return objChildName;
3737
}

src/app/types/AppTypes.ts

Whitespace-only changes.

src/backend/__tests__/astParser.test.js

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -57,69 +57,3 @@ describe('AST Unit Tests', () => {
5757
});
5858
});
5959
});
60-
61-
/* /*
62-
console.log('getHooksNames: ', getHooksNames(`function LastSnapshot(props) {
63-
var _useState = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(''),
64-
_useState2 = _slicedToArray(_useState, 2),
65-
currentSnapshot = _useState2[0],
66-
setCurrentSnapshot = _useState2[1];
67-
68-
var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(25),
69-
_useState4 = _slicedToArray(_useState3, 2),
70-
testState = _useState4[0],
71-
setTestState = _useState4[1];
72-
73-
var _useState5 = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(50),
74-
_useState6 = _slicedToArray(_useState5, 2),
75-
testState2 = _useState6[0],
76-
setTestState2 = _useState6[1];
77-
78-
function replacer(name, val) {
79-
// Ignore the key that is the name of the state variable
80-
if (name === 'currentSnapshot') {
81-
console.log('filtering currentSnapshot from display');
82-
return undefined;
83-
}
84-
85-
return val;
86-
}
87-
88-
Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
89-
window.addEventListener('message', function (_ref) {
90-
var _ref$data = _ref.data,
91-
action = _ref$data.action,
92-
payload = _ref$data.payload;
93-
94-
if (action === 'recordSnap') {
95-
console.log('stringifying payload:', payload);
96-
var payloadContent = JSON.stringify(payload, replacer, 1);
97-
setCurrentSnapshot(payloadContent);
98-
setTestState(function (state) {
99-
return state * 2;
100-
});
101-
setTestState2(function (state) {
102-
return state * 2;
103-
});
104-
console.log('current snapshot', currentSnapshot);
105-
}
106-
});
107-
}, []);
108-
/*
109-
// This method is for testing. Setting state after the activeSandbox is changed modifies the overall behavior of the sandbox environment.
110-
const { activeSandbox } = props;
111-
useEffect(() => {
112-
// Reset the current snapshot when a new sandbox is entered
113-
setCurrentSnapshot('');
114-
}, [activeSandbox]);
115-
*/
116-
/*
117-
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
118-
id: "lastSnapshot",
119-
className: "ml-5 mt-2",
120-
style: {
121-
whiteSpace: 'pre'
122-
}
123-
}, testState, testState2, currentSnapshot));
124-
};`));
125-
*/

0 commit comments

Comments
 (0)