Skip to content

Commit 5570acf

Browse files
kevin-lannthomasyzy7Austin-Xminhhaitran08MasahisaSekita
authored
Release/1.3 [develop] (#92)
Co-authored-by: dawangk <[email protected]> Co-authored-by: Austin-X <[email protected]> Co-authored-by: minhhaitran08 <[email protected]> Co-authored-by: Masahisa Sekita <[email protected]> Co-authored-by: Dmitriy Prokopchuk <[email protected]> Co-authored-by: Austin-X <[email protected]> Co-authored-by: dawangk <[email protected]> Co-authored-by: kevin-lann <[email protected]> Co-authored-by: MasahisaSekita <[email protected]>
1 parent 32ef75d commit 5570acf

File tree

9 files changed

+123
-4
lines changed

9 files changed

+123
-4
lines changed

course-matrix/backend/src/routes/courseRouter.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import express from "express";
2-
32
import coursesController from "../controllers/coursesController";
43
import departmentsController from "../controllers/departmentsController";
54
import offeringsController from "../controllers/offeringsController";
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export default "SvgrURL";
2+
export const ReactComponent = "div";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import "@testing-library/jest-dom";
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"compilerOptions": {
3+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4+
"target": "ES2020",
5+
"useDefineForClassFields": true,
6+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
7+
"module": "ESNext",
8+
"skipLibCheck": true,
9+
10+
/* Bundler mode */
11+
"moduleResolution": "bundler",
12+
"allowImportingTsExtensions": true,
13+
"isolatedModules": true,
14+
"moduleDetection": "force",
15+
"noEmit": true,
16+
"jsx": "react-jsx",
17+
18+
/* Linting */
19+
"strict": true,
20+
"noUnusedLocals": true,
21+
"noUnusedParameters": true,
22+
"noFallthroughCasesInSwitch": true,
23+
"noUncheckedSideEffectImports": true,
24+
25+
"baseUrl": ".",
26+
"paths": {
27+
"@/*": ["./src/*"]
28+
}
29+
},
30+
"include": ["src", "tests/setupTests.ts"]
31+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import configureStore from "redux-mock-store";
2+
import { UserMenu } from "../src/components/UserMenu";
3+
import { afterEach, beforeEach, describe, expect, test } from "@jest/globals";
4+
5+
// const mockStore = configureStore([]);
6+
7+
describe("UserMenu Component", () => {
8+
beforeEach(() => {
9+
localStorage.setItem(
10+
"userInfo",
11+
JSON.stringify({
12+
user: {
13+
id: "123",
14+
user_metadata: {
15+
username: "John Doe",
16+
17+
},
18+
},
19+
}),
20+
);
21+
});
22+
23+
afterEach(() => {
24+
localStorage.clear();
25+
});
26+
27+
test("check local storage", () => {
28+
expect(localStorage.getItem("userInfo")).not.toBeNull();
29+
});
30+
31+
// Will finish the rest of the tests below in Sprint 3
32+
33+
// test("opens edit account dialog", () => {
34+
// render(
35+
// <Provider store={store}>
36+
// <Router>
37+
// <UserMenu />
38+
// </Router>
39+
// </Provider>,
40+
// );
41+
42+
// fireEvent.click(screen.getByText("John Doe"));
43+
// fireEvent.click(screen.getByText("Edit Account"));
44+
45+
// expect(screen.getByText("Edit Account")).toBeInTheDocument();
46+
// expect(screen.getByLabelText("New User Name")).toBeInTheDocument();
47+
// });
48+
49+
// test("opens delete account dialog", () => {
50+
// render(
51+
// <Provider store={store}>
52+
// <Router>
53+
// <UserMenu />
54+
// </Router>
55+
// </Provider>,
56+
// );
57+
58+
// fireEvent.click(screen.getByText("John Doe"));
59+
// fireEvent.click(screen.getByText("Delete Account"));
60+
61+
// expect(screen.getByText("Delete Account")).toBeInTheDocument();
62+
// expect(
63+
// screen.getByText(
64+
// "Are you sure you want to delete your account? This action cannot be undone.",
65+
// ),
66+
// ).toBeInTheDocument();
67+
// });
68+
69+
// test("logs out user", () => {
70+
// render(
71+
// <Provider store={store}>
72+
// <Router>
73+
// <UserMenu />
74+
// </Router>
75+
// </Provider>,
76+
// );
77+
78+
// fireEvent.click(screen.getByText("John Doe"));
79+
// fireEvent.click(screen.getByText("Logout"));
80+
81+
// // Add assertions to check if the user is logged out
82+
// });
83+
});

course-matrix/frontend/src/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,4 @@ input:-webkit-autofill:focus {
153153
[class*="sx__"] {
154154
transition-duration: 0s !important;
155155
animation-duration: 0s !important;
156-
}
156+
}

course-matrix/frontend/src/pages/TimetableBuilder/TimetableBuilder.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ const TimetableBuilder = () => {
363363
className="space-y-8"
364364
>
365365
<div className="flex gap-8 w-full">
366-
<FormField
366+
{/* <FormField
367367
control={form.control}
368368
name="semester"
369369
render={({ field }) => (
@@ -395,7 +395,7 @@ const TimetableBuilder = () => {
395395
<FormMessage />
396396
</FormItem>
397397
)}
398-
/>
398+
/> */}
399399

400400
<FormField
401401
control={form.control}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export default "SvgrURL";
2+
export const ReactComponent = "div";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import "@testing-library/jest-dom";

0 commit comments

Comments
 (0)