Skip to content

Commit d665203

Browse files
committed
merged in dev
2 parents 4798cb8 + 839f291 commit d665203

File tree

6 files changed

+39
-12
lines changed

6 files changed

+39
-12
lines changed

main_process/main_httpController.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ const httpController = {
229229
reqResObj.isHTTP2 = true;
230230
reqResObj.timeReceived = Date.now();
231231
response.headers = headers;
232+
response.status = headers[':status'];
232233

233234
// if cookie exists, parse the cookie(s)
234235
if (headers['set-cookie']) {
@@ -285,6 +286,16 @@ const httpController = {
285286

286287
reqResObj.response.events.push(dataEvent);
287288

289+
290+
console.log('this is reqresobj respons right beforetest', reqResObj.response);
291+
// check if there is a test script to run
292+
if (reqResObj.request.testContent) {
293+
reqResObj.response.testResult = testingController.runTest(
294+
reqResObj.request.testContent,
295+
reqResObj
296+
);
297+
}
298+
288299
event.sender.send('reqResUpdate', reqResObj);
289300
});
290301
},

main_process/main_testingController.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint-disable no-useless-escape */
22
const { NodeVM } = require('vm2');
33
const chai = require('chai');
4+
const { status } = require('@grpc/grpc-js');
45

56
const testHttpController = {};
67

@@ -12,6 +13,13 @@ testHttpController.runTest = (
1213
) => {
1314
const { request } = reqResObj;
1415
let { response } = reqResObj;
16+
17+
console.log('this is response in backend', response);
18+
console.log('HSOULD BE HEADERS', response.headers);
19+
console.log('is status acessable', response.status);
20+
console.log('TRYING WITH BRackets', response.headers[':status']);
21+
// console.log('TRYING WITH just colon', response.headers:status);
22+
1523
// final test result objects will be stored in this array
1624
const testResults = [];
1725

@@ -70,9 +78,9 @@ testHttpController.runTest = (
7078
7179
addOneResult({
7280
message: errObj.message,
73-
status: 'FAIL',
81+
status: 'FAILhi',
7482
expected: errObj.expected,
75-
actual: errObj.actual,
83+
actual: err,
7684
});
7785
}
7886
`;
@@ -90,6 +98,7 @@ testHttpController.runTest = (
9098
vm.run(testScript, 'main.js');
9199
// deep clone the testResults array since sending functions, DOM elements, and non-cloneable
92100
// JS objects is not supported IPC channels past Electron 9
101+
// console.log('this is test results from back end', testResults);
93102
return JSON.parse(JSON.stringify(testResults));
94103
} catch (err) {
95104
console.log(

src/assets/style/base.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ input:focus {
3434
color: $neutral-100;
3535
display: flex;
3636
align-items: center;
37-
justify-content: space-around;
37+
justify-content: space-between;
3838
height: 2.5rem !important;
3939
opacity: 0.8;
4040
margin: 0;

src/client/components/main/TRPC-composer/TRPCMethodAndEndpointEntryForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useSelector, useDispatch } from 'react-redux';
77
import { RootState } from '../../../toolkit-refactor/store';
88
import { fieldsReplaced } from '../../../toolkit-refactor/slices/newRequestFieldsSlice';
99

10-
const TRPCMethodAndEndpointEntryForm = (props) => {
10+
const TRPCMethodAndEndpointEntryForm = (props: any) => {
1111
const requestFields = useSelector(
1212
(state: RootState) => state.newRequestFields
1313
);

src/client/components/navbar/GeneralInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export default function GeneralInfo() {
2626
data-show-count="true"
2727
aria-label="Star open-source-labs/Swell on GitHub"
2828
>
29-
Star
3029
</GitHubButton>
30+
3131
</Box>
3232
);
3333
}

src/client/components/navbar/ProtocolSelect.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const CustomButton = styled(ButtonUnstyled)`
4646
transition: all 150ms ease;
4747
cursor: pointer;
4848
border: none;
49-
width: 8vw;
49+
width: 15vw;
5050
5151
&:hover,
5252
&:active {
@@ -154,29 +154,36 @@ function ProtocolSelect() {
154154
});
155155
};
156156

157+
/*EXPERIMENTAL BUTTONS ARE COMMENTED OUT BELOW:
158+
We did this because having partially working features accessible to all seemed counter-intuitive
159+
to having a fully functional application for any user to download and use. Some experimentals
160+
are closer to fully-functional more than others and if they do get fleshed out they can be added
161+
to the other set of functional features*/
162+
157163
return (
158164
<Box
159165
key="page-selector"
160166
sx={{
161167
flexGrow: 1,
162168
display: { xs: 'none', md: 'flex' },
163-
justifyContent: 'center',
169+
justifyContent: 'space-evenly',
164170
alignItems: 'center',
165171
}}
166172
>
167173
{createButtons(pages)}
168-
<Divider sx={{ ml: 1 }} orientation="vertical" flexItem />
169-
<SwellTooltip title={experimentalTooltipText}>
170-
<ScienceRoundedIcon
174+
175+
{/* <Divider sx={{ ml: 1 }} orientation="vertical" flexItem /> */}
176+
{/* <SwellTooltip title={experimentalTooltipText}> */}
177+
{/* <ScienceRoundedIcon
171178
sx={{
172179
ml: 1.5,
173180
mr: 1,
174181
color: `${white[500]}`,
175182
'&:hover': { color: '#58a4b0' },
176183
}}
177184
/>
178-
</SwellTooltip>
179-
{createButtons(experimentalPages)}
185+
</SwellTooltip> */}
186+
{/* {createButtons(experimentalPages)} */}
180187
</Box>
181188
);
182189
}

0 commit comments

Comments
 (0)