Skip to content

Commit 1140ac6

Browse files
committed
Cleaned up ReacType files and console.logs
> > Co-authored-by: slhoehn <[email protected]>
1 parent 98fbbbd commit 1140ac6

File tree

6 files changed

+22
-23
lines changed

6 files changed

+22
-23
lines changed

__tests__/componentReducer.test.ts

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,26 @@ describe('Testing componentReducer functionality', () => {
2626
});
2727
});
2828

29-
// TEST 'ADD COMPONENT' with new root
30-
describe('ADD COMPONENT reducer', () => {
31-
it('should add new reuseable component to state as the new root', () => {
32-
const action: Action = {
33-
type: 'ADD COMPONENT',
34-
payload: {
35-
componentName: 'TestRootChange',
36-
id: 3,
37-
root: true,
38-
},
39-
};
40-
state = reducer(state, action);
41-
42-
// expect state.components array to have length 3
43-
const length = state.components.length;
44-
expect(length).toEqual(3);
45-
// expect new root to match id of component id of TestRootChange
46-
expect(state.rootComponents[state.rootComponents.length - 1]).toEqual(action.payload.id);
29+
// TEST 'ADD COMPONENT' with new root
30+
describe('ADD COMPONENT reducer', () => {
31+
it('should add new reuseable component to state as the new root', () => {
32+
const action: Action = {
33+
type: 'ADD COMPONENT',
34+
payload: {
35+
componentName: 'TestRootChange',
36+
id: 3,
37+
root: true,
38+
},
39+
};
40+
state = reducer(state, action);
41+
42+
// expect state.components array to have length 3
43+
const length = state.components.length;
44+
expect(length).toEqual(3);
45+
// expect new root to match id of component id of TestRootChange
46+
expect(state.rootComponents[state.rootComponents.length - 1]).toEqual(action.payload.id);
47+
});
4748
});
48-
});
4949

5050
// TEST 'ADD CHILD'
5151
describe('ADD CHILD reducer', () => {
@@ -204,6 +204,7 @@ describe('Testing componentReducer functionality', () => {
204204
}
205205
}
206206
state = reducer(state, actionHTML2);
207+
// invoking snapShotFunc is necessary to push actions into the past array, referenced in the UNDO functionality to define children
207208
snapShotFuncCopy();
208209

209210
const actionUndo: Action = {

app/src/Dashboard/FormsContainer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const FormsContainer = () => {
1919
if (error) return <p>Error :{error}</p>;
2020
// based on resolver(readAllTests) for this query, the data is stored in the data object with the key 'readAllTests'
2121
const myTests = data.readAllTests;
22-
console.log('myTests', myTests);
2322
// generate an array of Form components based on data
2423
const forms = myTests.map((test, index) => <Form key={index} id={test.id} description={test.description} likes={test.likes}/>);
2524

app/src/components/login/SignIn.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ const SignIn: React.FC<LoginInt & RouteComponentProps> = props => {
7575
window.api.setCookie();
7676
window.api.getCookie(cookie => {
7777
// if a cookie exists, set localstorage item with cookie data, clear interval, go back to '/' route to load app
78-
console.log(cookie);
7978
if (cookie[0]) {
8079
window.localStorage.setItem('ssid', cookie[0].value);
8180
clearInterval(githubCookie);

app/src/components/main/Canvas.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,3 @@ function Canvas() {
9797
}
9898

9999
export default Canvas;
100-

app/src/components/main/DirectChildHTML.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ function DirectChildHTML({
4848
function onClickHandler(event) {
4949
event.stopPropagation();
5050
changeFocus(state.canvasFocus.componentId, childId);
51-
console.log('state in directChild', state)
5251
}
5352

5453
// combine all styles so that higher priority style specifications overrule lower priority style specifications

app/src/reducers/componentReducer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ const reducer = (state: State, action: Action) => {
619619
HTMLTypes
620620
};
621621
}
622+
622623
case 'UNDO': {
623624
const focusIndex = state.canvasFocus.componentId - 1;
624625
// if the past array is empty, return state
@@ -644,6 +645,7 @@ const reducer = (state: State, action: Action) => {
644645
...state
645646
};
646647
}
648+
647649
case 'REDO': {
648650
const focusIndex = state.canvasFocus.componentId - 1;
649651
//if future array is empty, return state

0 commit comments

Comments
 (0)