From 36aee971c41be5bbe62118653d1879fd8d09db44 Mon Sep 17 00:00:00 2001 From: Guangya Liu Date: Tue, 12 Sep 2023 11:16:11 -0400 Subject: [PATCH 1/3] fix test errors --- tests/test_endpoints.py | 4 ++-- tests/test_validate_code.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_endpoints.py b/tests/test_endpoints.py index cbb1eb08c..9936df52f 100644 --- a/tests/test_endpoints.py +++ b/tests/test_endpoints.py @@ -267,7 +267,7 @@ def square(x) assert response3.status_code == 200 assert response3.json() == { "imports": {"errors": []}, - "function": {"errors": ["expected ':' (, line 4)"]}, + "function": {"errors": ["invalid syntax (, line 4)"]}, } # Test case with invalid JSON payload @@ -290,7 +290,7 @@ def square(x) assert response6.status_code == 200 assert response6.json() == { "imports": {"errors": []}, - "function": {"errors": ["expected ':' (, line 4)"]}, + "function": {"errors": ["invalid syntax (, line 4)"]}, } diff --git a/tests/test_validate_code.py b/tests/test_validate_code.py index cacf3669c..87ff6b7e4 100644 --- a/tests/test_validate_code.py +++ b/tests/test_validate_code.py @@ -44,7 +44,7 @@ def square(x) errors3 = validate_code(code3) assert errors3 == { "imports": {"errors": []}, - "function": {"errors": ["expected ':' (, line 4)"]}, + "function": {"errors": ["invalid syntax (, line 4)"]}, } From 48586fc3e669b189886f89919aabf8809a3beba7 Mon Sep 17 00:00:00 2001 From: Guangya Liu Date: Tue, 12 Sep 2023 11:17:11 -0400 Subject: [PATCH 2/3] Fix format errors --- .../src/icons/GradientSparkles/index.tsx | 65 ++++++++++--------- src/frontend/src/pages/AdminPage/index.tsx | 2 +- src/frontend/src/utils/styleUtils.ts | 2 +- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/src/frontend/src/icons/GradientSparkles/index.tsx b/src/frontend/src/icons/GradientSparkles/index.tsx index 49502c6ba..55e8d3977 100644 --- a/src/frontend/src/icons/GradientSparkles/index.tsx +++ b/src/frontend/src/icons/GradientSparkles/index.tsx @@ -1,38 +1,39 @@ import { forwardRef } from "react"; -export const GradientSparkles = forwardRef>( - (props, ref) => { - return ( - <> - - - - - - - - - {/* this svg comes from the source code of lucide, +export const GradientSparkles = forwardRef< + SVGSVGElement, + React.PropsWithChildren<{}> +>((props, ref) => { + return ( + <> + + + + + + + + + {/* this svg comes from the source code of lucide, we do not use the import because it crashes the ui (why? no one knows...). source code from the used svg: https://github.com/lucide-icons/lucide/blob/a4076db69b52ff0debc383f76d4d671c3bad5345/icons/infinity.svg?short_path=f79de91 */} - - - - - ); - } -); - + + + + + ); +}); diff --git a/src/frontend/src/pages/AdminPage/index.tsx b/src/frontend/src/pages/AdminPage/index.tsx index bcdc78b5f..24baefb5b 100644 --- a/src/frontend/src/pages/AdminPage/index.tsx +++ b/src/frontend/src/pages/AdminPage/index.tsx @@ -190,7 +190,7 @@ export default function AdminPage() { setSuccessData({ title: "Success! New user added!", }); - }) + }); }) .catch((error) => { setErrorData({ diff --git a/src/frontend/src/utils/styleUtils.ts b/src/frontend/src/utils/styleUtils.ts index bd658ac7e..01b00b669 100644 --- a/src/frontend/src/utils/styleUtils.ts +++ b/src/frontend/src/utils/styleUtils.ts @@ -89,7 +89,7 @@ import { EvernoteIcon } from "../icons/Evernote"; import { FBIcon } from "../icons/FacebookMessenger"; import { GitBookIcon } from "../icons/GitBook"; import { GoogleIcon } from "../icons/Google"; -import {GradientSparkles} from "../icons/GradientSparkles"; +import { GradientSparkles } from "../icons/GradientSparkles"; import { HuggingFaceIcon } from "../icons/HuggingFace"; import { IFixIcon } from "../icons/IFixIt"; import { MetaIcon } from "../icons/Meta"; From f0ba05c9cc9fb10ea728f9ebcb9048659368462c Mon Sep 17 00:00:00 2001 From: Guangya Liu Date: Tue, 12 Sep 2023 11:52:14 -0400 Subject: [PATCH 3/3] rollback the test error with python 3.10 --- tests/test_endpoints.py | 4 ++-- tests/test_validate_code.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_endpoints.py b/tests/test_endpoints.py index 9936df52f..cbb1eb08c 100644 --- a/tests/test_endpoints.py +++ b/tests/test_endpoints.py @@ -267,7 +267,7 @@ def square(x) assert response3.status_code == 200 assert response3.json() == { "imports": {"errors": []}, - "function": {"errors": ["invalid syntax (, line 4)"]}, + "function": {"errors": ["expected ':' (, line 4)"]}, } # Test case with invalid JSON payload @@ -290,7 +290,7 @@ def square(x) assert response6.status_code == 200 assert response6.json() == { "imports": {"errors": []}, - "function": {"errors": ["invalid syntax (, line 4)"]}, + "function": {"errors": ["expected ':' (, line 4)"]}, } diff --git a/tests/test_validate_code.py b/tests/test_validate_code.py index 87ff6b7e4..cacf3669c 100644 --- a/tests/test_validate_code.py +++ b/tests/test_validate_code.py @@ -44,7 +44,7 @@ def square(x) errors3 = validate_code(code3) assert errors3 == { "imports": {"errors": []}, - "function": {"errors": ["invalid syntax (, line 4)"]}, + "function": {"errors": ["expected ':' (, line 4)"]}, }