Skip to content

Commit 07d447e

Browse files
Justinlkirkastholdenwilliamowen65
committed
Finalized dependency injections schema
Co-authored-by: Alexander Holden <[email protected]> Co-authored-by: William Owen <[email protected]> Co-authored-by: Jessica Lee <[email protected]>'
1 parent ca86edb commit 07d447e

File tree

11 files changed

+10
-15
lines changed

11 files changed

+10
-15
lines changed
File renamed without changes.

__tests__2022/routes/data.test.ts

Whitespace-only changes.

__tests__2022/routes/users.test.ts

Whitespace-only changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"setupRequired":false,"services":[["myPostgres","SQL","postgres://zwezmnqm:[email protected]:5432/zwezmnqm","Online bookstore with that keeps track of orders and customers","Jun 28, 2020 4:58 PM"],["ToddDB","MongoDB","mongodb+srv://tdwolf6:[email protected]/Chronos?retryWrites=true&w=majority","Web app deployed on AWS","Jul 3, 2020 7:12AM"]],"mode":"dark mode","splash":true}
1+
{"setupRequired":false,"services":[["myPostgres","SQL","postgres://zwezmnqm:[email protected]:5432/zwezmnqm","Online bookstore with that keeps track of orders and customers","Jun 28, 2020 4:58 PM"],["ToddDB","MongoDB","mongodb+srv://tdwolf6:[email protected]/Chronos?retryWrites=true&w=majority","Web app deployed on AWS","Jul 3, 2020 7:12AM"]],"mode":"dark mode","splash":true,"landingPage":"login"}

__tests__2022/test_users.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"[email protected]":{"email":"[email protected]","username":"me","password":"1234","admin":true,"awaitingApproval":false},"[email protected]":{"email":"[email protected]","username":"you","password":"1234","admin":false,"awaitingApproval":false}}

app/components/CreateAdmin.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,8 @@ const CreateAdmin = React.memo(() => {
1414
const password = inputFields[2].value;
1515

1616
const validSignUp = ipcRenderer.sendSync('addUser', { email, username, password });
17-
if (validSignUp) {
18-
window.alert(
19-
'Your admin account has been created. Use this account to approve other accounts.'
20-
);
21-
updateLandingPage('login');
22-
} else window.alert('Sorry your sign up cannot be completed at this time. Please try again.');
17+
if (validSignUp) updateLandingPage('login');
18+
else window.alert('Sorry your sign up cannot be completed at this time. Please try again.');
2319
};
2420

2521
return (

electron/routes/dashboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import fs from 'fs';
1111
// Loads existing settings JSON and update settings to include new services entered by the user on 'submit' request
1212
let settingsLocation;
1313
if (process.env.NODE_ENV === 'development')
14-
settingsLocation = path.resolve(__dirname, '../../test_settings.json');
14+
settingsLocation = path.resolve(__dirname, '../../__tests__2022/test_settings.json');
1515
else settingsLocation = path.resolve(__dirname, '../../settings.json');
1616
ipcMain.on('addApp', (message: IpcMainEvent, application: any) => {
1717
// Retrieves file contents from settings.json

electron/routes/data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ let currentDatabaseType: string;
2424
*/
2525
let settingsLocation;
2626
if (process.env.NODE_ENV === 'development')
27-
settingsLocation = path.resolve(__dirname, '../../test_settings.json');
27+
settingsLocation = path.resolve(__dirname, '../../__tests__2022/test_settings.json');
2828
else settingsLocation = path.resolve(__dirname, '../../settings.json');
2929
ipcMain.on('connect', async (message: Electron.IpcMainEvent, index: number) => {
3030
try {

electron/routes/user.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { ipcMain, IpcMainEvent } from 'electron';
22
import path from 'path';
33
import fs from 'fs';
4-
5-
require('dotenv').config();
64
/**
75
* @event addApp
86
* @desc Adds an application to the user's list in the settings.json with the provided fields
@@ -13,8 +11,8 @@ let settingsLocation;
1311
let usersLocation;
1412

1513
if (process.env.NODE_ENV === 'development') {
16-
settingsLocation = path.resolve(__dirname, '../../test_settings.json');
17-
usersLocation = path.resolve(__dirname, '../../test_users.json');
14+
settingsLocation = path.resolve(__dirname, '../../__tests__2022/test_settings.json');
15+
usersLocation = path.resolve(__dirname, '../../__tests__2022/test_users.json');
1816
} else {
1917
settingsLocation = path.resolve(__dirname, '../../settings.json');
2018
usersLocation = path.resolve(__dirname, '../../users.json');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"start": "webpack serve",
99
"nodemon": "nodemon server/server.js",
1010
"electron": "electron .",
11-
"electronTest": "cross-env NODE_ENV=devleopment electron .",
11+
"electronTest": "cross-env NODE_ENV=development electron .",
1212
"electron:wsl": "electron . --no-sandbox",
1313
"test": "jest ./__tests__2022/*",
1414
"test:watch": "jest --watch",

0 commit comments

Comments
 (0)