Skip to content

Commit 5770f75

Browse files
authored
Merge pull request #6 from oslabs-beta/toolkit-integration
Update todos and comments
2 parents a6dbce3 + 4d78692 commit 5770f75

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+653
-440
lines changed

__tests__/composerTests.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
/**
2+
* @file This entire file has been commented out, since all testing was done in
3+
* Enzyme, which is quickly losing relevance and is no longer the best tool for
4+
* testing frontend applications, especially React applications.
5+
*
6+
* @todo For the next tester, recommended that logic be migrated over to
7+
* React Testing Library.
8+
*/
9+
110
/* eslint-disable react/jsx-props-no-spreading */
211
// import React from 'react';
312
// import ProtocolSelect from '../src/client/components/composer/NewRequest/ProtocolSelect.jsx';
413

5-
// Commented out this file since it is using Enzyme, which has been falling out of favor and currently does not work for this app version
6-
// TODO: for the next tester, recommended to migrate to React Testing Library
7-
814
// import { configure, shallow } from 'enzyme';
915
// import Adapter from 'enzyme-adapter-react-16';
1016

__tests__/httpTest.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import ReqResCtrl from '../src/client/controllers/reqResController';
22

3-
// TODO: Integration tests with the actual API. The controller calls api.send and api.recieve
4-
// without attachement to the API, the tests in this file don't perform anything.
5-
// Additionally, add a testing file for graphQLController. This is currently untested
6-
// and is a dependency for reqResController.
7-
8-
/**@todo refactor for new state structure with redux slices */
3+
/**
4+
* @todo Integration tests with the actual API. The controller calls api.send
5+
* and api.recieve without attachement to the API, the tests in this file don't
6+
* perform anything.
7+
*
8+
* Additionally, add a testing file for graphQLController. This is currently
9+
* untested and is a dependency for reqResController.
10+
*
11+
* @todo Refactor for new state structure with redux slices
12+
*/
913

1014
describe('REST API Requests', () => {
1115
let state;

__tests__/openAPIParserTest.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
const fs = require('fs');
22
const path = require('path');
33

4-
import openapiParserFunc from '../main_process/openapiParser'
4+
import openapiParserFunc from '../main_process/openapiParser';
55

6-
// TODO: Test actual contents of the parser
6+
/** @todo Test the actual contents of the parser */
7+
describe('openAPI Parser tests', () => {
8+
const file = fs.readFileSync(
9+
path.resolve(__dirname + '/../test/openAPITestDefinition.yaml')
10+
);
711

8-
describe('openAPI Parser tests',()=>{
9-
const file = fs.readFileSync(path.resolve(__dirname + '/../test/openAPITestDefinition.yaml'))
10-
11-
it('should be able to parse a yaml file',()=>{
12-
const { openapiMetadata, openapiReqArray } = openapiParserFunc(String(file))
12+
it('should be able to parse a yaml file', () => {
13+
const { openapiMetadata, openapiReqArray } = openapiParserFunc(
14+
String(file)
15+
);
1316
expect(openapiMetadata).toBeDefined();
1417
expect(openapiReqArray).toBeDefined();
15-
})
18+
});
1619

17-
it('should error on undefined input',()=>{
20+
it('should error on undefined input', () => {
1821
expect(openapiParserFunc(null)).toThrow(ReferenceError);
19-
})
20-
});
22+
});
23+
});

main.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
// Import parts of electron to use
3131
// app - Control your application's event lifecycle
3232
// ipcMain - Communicate asynchronously from the main process to renderer processes
33-
33+
// ** Entry point for Electron **
3434
const { app, BrowserWindow, ipcMain, dialog, shell } = require('electron');
3535

3636
const { autoUpdater } = require('electron-updater');
@@ -204,7 +204,12 @@ function createWindow() {
204204
app.on('ready', () => {
205205
createWindow();
206206
if (!isDev) {
207-
// TODO: this is crucial code! run express server if production mode
207+
/**
208+
* Note: Even though Express is not used for the duration of the block, this
209+
* is crucial code, and while VS Code will flag it as not being used, it
210+
* should not be removed. Express server is used in production mode as there
211+
* is no dev server.
212+
*/
208213
const express = require('./src/server/server');
209214
autoUpdater.checkForUpdates();
210215
}
@@ -304,7 +309,7 @@ app.on('activate', () => {
304309

305310
ipcMain.on('import-from-github', async (event, args) => {
306311
async function popOverwrite(collection) {
307-
// TODO: add in mod date, is Yes No ordering correct on popup?
312+
/** @todo add in mod date, is Yes No ordering correct on popup? */
308313
const options = {
309314
type: 'question',
310315
buttons: ['No', 'Yes'],

main_process/openapiParser.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
const YAML = require('yamljs');
22

3-
// TODO: Validation, Callbacks
3+
/**
4+
* @todo The previous todo just said "Validation, Callbacks". That's it. Maybe
5+
* it means to add validation and to refactor this to add support for callbacks?
6+
*/
47
const openapiParserFunc = (input) => {
58
if (input === undefined || input === null)
69
ReferenceError('OpenAPI Document not found.');

src/client/components/App.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ import ErrorBoundary from './utilities/ErrorBoundary/ErrorBoundary';
2121

2222
// Import styling
2323
/**
24+
* @todo
2425
* Note to future devs:
25-
* Our team is finishing our work on this app, and part of our stretch goals
26-
* were to migrate all of the existing components to use Material UI. We made
27-
* this decision for a few reasons:
26+
* Our team was not able to complete migrating all of the existing components
27+
* to use Material UI. This should be finished for a couple of reasons:
2828
*
29-
* (1) There are a toooon of people who work on this application. It needs
30-
* consistent styling, and making changes to the SASS files can really
31-
* complicate development of the app.
29+
* (1) This application needs consistent styling, and making changes to the
30+
* SASS files can really complicate development of the app.
3231
*
3332
* (2) Material UI is very easy to use and very supported. If you know React and
3433
* a touch of CSS, you'll be able to quickly make visually-compatible components

src/client/components/main/GRPCComposer.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import { v4 as uuid } from 'uuid';
33
// Import controllers
44
import historyController from '../../controllers/historyController';
55
// Import local components
6-
// TODO: refactor all of the below components to use MUI, place them in a new "components" folder
6+
7+
/**
8+
* @todo Refactor all of the below components to use MUI, place them in a new
9+
* "components" folder
10+
*/
711
import GRPCTypeAndEndpointEntryForm from './new-request/GRPCTypeAndEndpointEntryForm';
812
import HeaderEntryForm from './new-request/HeaderEntryForm';
913
import GRPCProtoEntryForm from './new-request/GRPCProtoEntryForm.jsx';
@@ -148,7 +152,7 @@ export default function GRPCComposer(props) {
148152
};
149153

150154
// add request to history
151-
// TODO: fix TS error
155+
/** @todo Fix TS error */
152156
historyController.addHistoryToIndexedDb(reqRes);
153157
reqResItemAdded(reqRes);
154158

@@ -190,7 +194,7 @@ export default function GRPCComposer(props) {
190194
className="is-flex-grow-3 add-vertical-scroll"
191195
style={{ overflowX: 'hidden' }}
192196
>
193-
{/* TODO: fix TSX typing errors */}
197+
{/**@todo Fix TSX typing errors */}
194198
<GRPCTypeAndEndpointEntryForm
195199
newRequestFields={newRequestFields}
196200
newRequestHeaders={newRequestHeaders}

src/client/components/main/GraphQLComposer.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { v4 as uuid } from 'uuid';
55
import historyController from '../../controllers/historyController';
66
// Import local components
77

8-
// TODO: refactor all of the below components to use MUI, place them in a new "components" folder
8+
/**
9+
* @todo Refactor all of the below components to use MUI, place them in a new
10+
* "components" folder
11+
*/
912
import HeaderEntryForm from './new-request/HeaderEntryForm.jsx';
1013
import GraphQLMethodAndEndpointEntryForm from './new-request/GraphQLMethodAndEndpointEntryForm';
1114
import CookieEntryForm from './new-request/CookieEntryForm';

src/client/components/main/OpenAPIComposer.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import { v4 as uuid } from 'uuid';
33
// Import controllers
44
import historyController from '../../controllers/historyController';
55
// Import local components
6-
// TODO: refactor all of the below components to use MUI, place them in a new "components" folder
6+
7+
/**
8+
* @todo Refactor all of the below components to use MUI, place them in a new
9+
* "components" folder
10+
*/
711
import NewRequestButton from './new-request/NewRequestButton.jsx';
812
import OpenAPIEntryForm from './new-request/OpenAPIEntryForm';
913
import OpenAPIDocumentEntryForm from './new-request/OpenAPIDocumentEntryForm.jsx';
@@ -97,7 +101,7 @@ export default function OpenAPIComposer(props) {
97101
};
98102

99103
// add request to history
100-
// TODO: fix TS type error
104+
/** @todo Fix TS type error */
101105
historyController.addHistoryToIndexedDb(reqRes);
102106
reqResItemAdded(reqRes);
103107

@@ -134,7 +138,7 @@ export default function OpenAPIComposer(props) {
134138
className="is-flex-grow-3 add-vertical-scroll"
135139
style={{ overflowX: 'hidden' }}
136140
>
137-
{/* TODO: fix TS type error */}
141+
{/** @todo fix TS type error */}
138142
<OpenAPIEntryForm
139143
newRequestFields={newRequestFields}
140144
newRequestHeaders={newRequestHeaders}

src/client/components/main/WebRTCComposer.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import { v4 as uuid } from 'uuid';
33
// Import controllers
44
import historyController from '../../controllers/historyController';
55
// Import local components
6-
// TODO: refactor all of the below components to use MUI, place them in a new "components" folder
6+
7+
/**
8+
* @todo Refactor all of the below components to use MUI, place them in a new
9+
* "components" folder
10+
*/
711
import WebRTCSessionEntryForm from './new-request/WebRTCSessionEntryForm.jsx';
812
import WebRTCServerEntryForm from './new-request/WebRTCServerEntryForm.jsx';
913
import NewRequestButton from './new-request/NewRequestButton.jsx';
@@ -85,7 +89,7 @@ export default function WebRTCComposer(props) {
8589
};
8690

8791
// add request to history
88-
// TODO: fix this TS type error
92+
/** @todo Fix this TS type error */
8993
historyController.addHistoryToIndexedDb(reqRes);
9094
reqResItemAdded(reqRes);
9195

@@ -115,7 +119,7 @@ export default function WebRTCComposer(props) {
115119
className="is-flex-grow-3 add-vertical-scroll"
116120
style={{ overflowX: 'hidden' }}
117121
>
118-
{/* TODO: fix TSX type error */}
122+
{/** @todo Fix TSX type error */}
119123
<WebRTCSessionEntryForm
120124
newRequestFields={newRequestFields}
121125
newRequestHeaders={newRequestHeaders}

0 commit comments

Comments
 (0)