From 49bbebe8f5baf0462bf57857433cc9d4cc9cc405 Mon Sep 17 00:00:00 2001 From: carddev81 Date: Mon, 23 Sep 2024 20:32:09 -0500 Subject: [PATCH] feat: removed unused files and uncomment out HTTP test scenario code --- backend/src/handlers/dashboard_test.go | 18 +-- backend/tests/test_data/courses.json | 142 ------------------ backend/tests/test_data/facilities.json | 27 ---- backend/tests/test_data/milestones.json | 91 ----------- .../tests/test_data/provider_platforms.json | 86 ----------- backend/tests/test_data/users.json | 101 ------------- 6 files changed, 9 insertions(+), 456 deletions(-) delete mode 100644 backend/tests/test_data/courses.json delete mode 100644 backend/tests/test_data/facilities.json delete mode 100644 backend/tests/test_data/milestones.json delete mode 100644 backend/tests/test_data/provider_platforms.json delete mode 100644 backend/tests/test_data/users.json diff --git a/backend/src/handlers/dashboard_test.go b/backend/src/handlers/dashboard_test.go index b2470079..b119124f 100644 --- a/backend/src/handlers/dashboard_test.go +++ b/backend/src/handlers/dashboard_test.go @@ -142,16 +142,16 @@ func TestHandleUserCatalogue(t *testing.T) { func TestHandleUserCourses(t *testing.T) { httpTests := []httpTest{ - //{"TestGetAllUserCoursesAsAdmin", "admin", getUserCoursesSearch(4, "", "", "", nil), http.StatusOK, ""}, - //{"TestGetAllUserCoursesAsUser", "student", getUserCoursesSearch(4, "", "", "", nil), http.StatusOK, ""}, + {"TestGetAllUserCoursesAsAdmin", "admin", getUserCoursesSearch(4, "", "", "", nil), http.StatusOK, ""}, + {"TestGetAllUserCoursesAsUser", "student", getUserCoursesSearch(4, "", "", "", nil), http.StatusOK, ""}, {"TestGetUserCoursesWithTagsAndOrderByPgNmDescAsUser", "student", getUserCoursesSearch(4, "desc", "program_name", "", []string{"certificate", "grade", "progress_completion"}), http.StatusOK, "?tags=certificate,grade,progress_completion,pathway_completion,college_credit&order=desc&order_by=program_name"}, - //{"TestGetUserCoursesWithTagsAndOrderByProvNmDescAsUser", "student", getUserCoursesSearch(4, "asc", "provider_name", "", []string{"certificate", "grade", "progress_completion"}), http.StatusOK, "?tags=certificate,grade,progress_completion,pathway_completion,college_credit&order=asc&order_by=provider_name"}, - //{"TestGetUserCoursesWithTagsAndOrderByCoursePgrDescAsUser", "student", getUserCoursesSearch(4, "desc", "course_progress", "", []string{"certificate", "grade", "progress_completion"}), http.StatusOK, "?tags=certificate,grade,progress_completion,pathway_completion,college_credit&order=desc&order_by=course_progress"}, - //{"TestGetUserCoursesWithTagsAndOrderByProvNmDescAsUser", "student", getUserCoursesSearch(4, "asc", "provider_name", "", []string{"certificate", "grade", "progress_completion"}), http.StatusOK, "?tags=certificate,grade,progress_completion,pathway_completion,college_credit&order=asc&order_by=provider_name"}, - //{"TestGetUserCoursesWithTagsAndOrderByIsFavdDescAsUser", "student", getUserCoursesSearch(4, "desc", "is_favorited", "", []string{"certificate", "grade", "progress_completion"}), http.StatusOK, "?tags=certificate,grade,progress_completion,pathway_completion,college_credit&order=desc&order_by=is_favorited"}, - //{"TestGetUserCoursesWithTagsAndOrderByTotalTmDescAsUser", "student", getUserCoursesSearch(4, "desc", "total_time", "", []string{"certificate", "grade", "progress_completion"}), http.StatusOK, "?tags=certificate,grade,progress_completion,pathway_completion,college_credit&order=desc&order_by=total_time"}, - //{"TestUserCoursesWithSearchAscAsUser", "student", getUserCoursesSearch(4, "asc", "", "of", []string{"certificate", "grade", "progress_completion", "pathway_completion", "college_credit"}), http.StatusOK, "?tags=certificate,grade,progress_completion,pathway_completion,college_credit&order=asc&search=of"}, - //{"TestUserCoursesWithSearchDescAsUser", "student", getUserCoursesSearch(4, "desc", "", "Intro", []string{"certificate", "grade", "progress_completion", "pathway_completion", "college_credit"}), http.StatusOK, "?tags=certificate,grade,progress_completion,pathway_completion,college_credit&order=desc&search=Intro"}, + {"TestGetUserCoursesWithTagsAndOrderByProvNmDescAsUser", "student", getUserCoursesSearch(4, "asc", "provider_name", "", []string{"certificate", "grade", "progress_completion"}), http.StatusOK, "?tags=certificate,grade,progress_completion,pathway_completion,college_credit&order=asc&order_by=provider_name"}, + {"TestGetUserCoursesWithTagsAndOrderByCoursePgrDescAsUser", "student", getUserCoursesSearch(4, "desc", "course_progress", "", []string{"certificate", "grade", "progress_completion"}), http.StatusOK, "?tags=certificate,grade,progress_completion,pathway_completion,college_credit&order=desc&order_by=course_progress"}, + {"TestGetUserCoursesWithTagsAndOrderByProvNmDescAsUser", "student", getUserCoursesSearch(4, "asc", "provider_name", "", []string{"certificate", "grade", "progress_completion"}), http.StatusOK, "?tags=certificate,grade,progress_completion,pathway_completion,college_credit&order=asc&order_by=provider_name"}, + {"TestGetUserCoursesWithTagsAndOrderByIsFavdDescAsUser", "student", getUserCoursesSearch(4, "desc", "is_favorited", "", []string{"certificate", "grade", "progress_completion"}), http.StatusOK, "?tags=certificate,grade,progress_completion,pathway_completion,college_credit&order=desc&order_by=is_favorited"}, + {"TestGetUserCoursesWithTagsAndOrderByTotalTmDescAsUser", "student", getUserCoursesSearch(4, "desc", "total_time", "", []string{"certificate", "grade", "progress_completion"}), http.StatusOK, "?tags=certificate,grade,progress_completion,pathway_completion,college_credit&order=desc&order_by=total_time"}, + {"TestUserCoursesWithSearchAscAsUser", "student", getUserCoursesSearch(4, "asc", "", "of", []string{"certificate", "grade", "progress_completion", "pathway_completion", "college_credit"}), http.StatusOK, "?tags=certificate,grade,progress_completion,pathway_completion,college_credit&order=asc&search=of"}, + {"TestUserCoursesWithSearchDescAsUser", "student", getUserCoursesSearch(4, "desc", "", "Intro", []string{"certificate", "grade", "progress_completion", "pathway_completion", "college_credit"}), http.StatusOK, "?tags=certificate,grade,progress_completion,pathway_completion,college_credit&order=desc&search=Intro"}, } for _, test := range httpTests { t.Run(test.testName, func(t *testing.T) { diff --git a/backend/tests/test_data/courses.json b/backend/tests/test_data/courses.json deleted file mode 100644 index 995aa918..00000000 --- a/backend/tests/test_data/courses.json +++ /dev/null @@ -1,142 +0,0 @@ -[ - { - "created_at": "2024-05-24T20:33:06.895116Z", - "updated_at": "2024-05-24T20:33:06.895116Z", - "provider_platform_id": 1, - "name": "Introduction to Botany", - "description": "This course covers the basics of plant biology, including plant structure, function, growth, and reproduction.", - "external_id": "98", - "thumbnail_url": "https://d2r55xnwy6nx47.cloudfront.net/uploads/2023/12/YIR-BIOLOGY-IbrahimRayintakath-Lede-scaled.webp", - "type": "open_enrollment", - "outcome_types": "grade,college_credit", - "external_url": "https://staging.canvas.unlockedlabs.xyz/courses/98", - "alt_name": "BOT101", - "total_progress_milestones": 12 - }, - { - "created_at": "2024-05-24T20:33:06.896726Z", - "updated_at": "2024-05-24T20:33:06.896726Z", - "provider_platform_id": 1, - "name": "Criminology and Justice", - "description": "Explore the causes, consequences, and prevention of criminal behavior through a study of the justice system.", - "external_id": "101", - "thumbnail_url": "https://news.fsu.edu/wp-content/uploads/2017/11/Seal-criminology-3x2.jpg", - "type": "open_enrollment", - "outcome_types": "grade,college_credit", - "external_url": "https://staging.canvas.unlockedlabs.xyz/courses/101", - "alt_name": "CRJ201", - "total_progress_milestones": 10 - }, - { - "created_at": "2024-05-24T20:33:06.897942Z", - "updated_at": "2024-05-24T20:33:06.897942Z", - "provider_platform_id": 1, - "name": "Introduction to Philosophy", - "description": "Delve into fundamental philosophical questions and explore various philosophical traditions and theories.", - "external_id": "103", - "thumbnail_url": "https://miro.medium.com/v2/resize:fit:938/1*ARpXbGZtzKkHbojQkawQKQ.jpeg", - "type": "open_enrollment", - "outcome_types": "grade,college_credit", - "external_url": "https://staging.canvas.unlockedlabs.xyz/courses/103", - "alt_name": "PHI101", - "total_progress_milestones": 10 - }, - { - "created_at": "2024-05-24T22:07:52.103425Z", - "updated_at": "2024-05-24T22:07:52.103425Z", - "provider_platform_id": 1, - "name": "Advanced Mathematics", - "description": "A comprehensive study of advanced mathematical concepts including calculus, linear algebra, and differential equations.", - "external_id": "258", - "thumbnail_url": "https://news.harvard.edu/wp-content/uploads/2022/11/iStock-mathproblems.jpg", - "type": "fixed_enrollment", - "outcome_types": "grade,college_credit", - "external_url": "https://staging.canvas.unlockedlabs.xyz/courses/258", - "alt_name": "MATH301", - "total_progress_milestones": 10 - }, - { - "created_at": "2024-05-24T22:07:52.103478Z", - "updated_at": "2024-05-24T22:07:52.103478Z", - "provider_platform_id": 1, - "name": "Introduction to Computer Science", - "description": "An introductory course in computer science, covering fundamental concepts such as algorithms, data structures, and software engineering.", - "external_id": "176", - "thumbnail_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e1/Computer_science_and_engineering.jpg/640px-Computer_science_and_engineering.jpg", - "type": "open_enrollment", - "outcome_types": "grade,college_credit", - "external_url": "https://staging.canvas.unlockedlabs.xyz/courses/176", - "alt_name": "CS101", - "total_progress_milestones": 12 - }, - { - "created_at": "2024-05-24T22:07:52.103510Z", - "updated_at": "2024-05-24T22:07:52.103510Z", - "provider_platform_id": 1, - "name": "Basics of Marketing", - "description": "Learn the fundamental principles of marketing, including market research, branding, and consumer behavior.", - "external_id": "754", - "thumbnail_url": "https://builtin.com/sites/www.builtin.com/files/styles/ckeditor_optimize/public/inline-images/marketing-pillar-page-marketing-overview_0.png", - "type": "open_enrollment", - "outcome_types": "grade,college_credit", - "external_url": "https://staging.canvas.unlockedlabs.xyz/courses/754", - "alt_name": "MKT101", - "total_progress_milestones": 8 - }, - { - "created_at": "2024-05-24T22:07:52.103520Z", - "updated_at": "2024-05-24T22:07:52.103520Z", - "provider_platform_id": 1, - "name": "Introduction to Psychology", - "description": "A comprehensive introduction to the science of psychology, including the study of mental processes and behavior.", - "external_id": "886", - "thumbnail_url": "https://www.udc.edu/social-udc/wp-content/uploads/sites/24/2018/03/Importance-of-Psychology_UDC.jpg", - "type": "open_enrollment", - "outcome_types": "grade,college_credit", - "external_url": "https://staging.canvas.unlockedlabs.xyz/courses/886", - "alt_name": "PSY101", - "total_progress_milestones": 8 - }, - { - "created_at": "2024-05-24T22:07:52.103551Z", - "updated_at": "2024-05-24T22:07:52.103551Z", - "provider_platform_id": 1, - "name": "Environmental Science", - "description": "Examine the interactions between the natural environment and human activity, focusing on sustainability and conservation.", - "external_id": "894", - "thumbnail_url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSNxnwEFPxa4ujQwSb3ebJQ0qScgFz7CEY14g&s", - "type": "open_enrollment", - "outcome_types": "grade,college_credit", - "external_url": "https://staging.canvas.unlockedlabs.xyz/courses/894", - "alt_name": "ENV201", - "total_progress_milestones": 14 - }, - { - "created_at": "2024-05-24T22:07:52.103570Z", - "updated_at": "2024-05-24T22:07:52.103570Z", - "provider_platform_id": 1, - "name": "Fundamentals of Physics", - "description": "Learn the basic principles of physics, including motion, energy, and the properties of matter.", - "external_id": "489", - "thumbnail_url": "https://media-cldnry.s-nbcnews.com/image/upload/newscms/2018_22/2451826/180601-atomi-mn-1540.jpg", - "type": "open_enrollment", - "outcome_types": "grade,college_credit", - "external_url": "https://staging.canvas.unlockedlabs.xyz/courses/489", - "alt_name": "PHY101", - "total_progress_milestones": 11 - }, - { - "created_at": "2024-05-24T22:07:52.103588Z", - "updated_at": "2024-05-24T22:07:52.103588Z", - "provider_platform_id": 1, - "name": "Modern Art History", - "description": "Explore the history and development of modern art from the late 19th century to the present.", - "external_id": "602", - "thumbnail_url": "https://www.invaluable.com/blog/wp-content/plugins/inv_art-history-timeline/images/2x/04-renaissance.jpg", - "type": "open_enrollment", - "outcome_types": "grade,college_credit", - "external_url": "https://staging.canvas.unlockedlabs.xyz/courses/602", - "alt_name": "ART201", - "total_progress_milestones": 10 - } -] diff --git a/backend/tests/test_data/facilities.json b/backend/tests/test_data/facilities.json deleted file mode 100644 index cdddc2dd..00000000 --- a/backend/tests/test_data/facilities.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "created_at": "2024-06-27T19:15:00.123456789Z", - "updated_at": "2024-06-27T19:15:00.123456789Z", - "name": "Jefferson City Correctional Center" - }, - { - "created_at": "2024-06-27T19:15:00.123456789Z", - "updated_at": "2024-06-27T19:15:00.123456789Z", - "name": "Missouri Eastern Correctional Center" - }, - { - "created_at": "2024-06-27T19:15:00.123456789Z", - "updated_at": "2024-06-27T19:15:00.123456789Z", - "name": "Potosi Correctional Center" - }, - { - "created_at": "2024-06-27T19:15:00.123456789Z", - "updated_at": "2024-06-27T19:15:00.123456789Z", - "name": "Farmington Correctional Center" - }, - { - "created_at": "2024-06-27T19:15:00.123456789Z", - "updated_at": "2024-06-27T19:15:00.123456789Z", - "name": "Algoa Correctional Center" - } -] diff --git a/backend/tests/test_data/milestones.json b/backend/tests/test_data/milestones.json deleted file mode 100644 index 1203b012..00000000 --- a/backend/tests/test_data/milestones.json +++ /dev/null @@ -1,91 +0,0 @@ -[ - { - "created_at": "2024-05-24T20:39:01.654448Z", - "updated_at": "2024-05-24T20:39:01.654448Z", - "user_id": 3, - "course_id": 1, - "external_id": "838", - "type": "assignment_submission", - "is_completed": true - }, - { - "created_at": "2024-05-24T20:39:01.656141Z", - "updated_at": "2024-05-24T20:39:01.656141Z", - "user_id": 3, - "course_id": 1, - "external_id": "847", - "type": "assignment_submission", - "is_completed": true - }, - { - "created_at": "2024-05-24T20:39:01.659777Z", - "updated_at": "2024-05-24T20:39:01.659777Z", - "user_id": 3, - "course_id": 1, - "external_id": "856", - "type": "assignment_submission", - "is_completed": true - }, - { - "created_at": "2024-05-24T20:39:01.66346Z", - "updated_at": "2024-05-24T20:39:01.66346Z", - "user_id": 3, - "course_id": 1, - "external_id": "865", - "type": "assignment_submission", - "is_completed": true - }, - { - "created_at": "2024-05-24T20:39:01.664468Z", - "updated_at": "2024-05-24T20:39:01.664468Z", - "user_id": 3, - "course_id": 1, - "external_id": "874", - "type": "assignment_submission", - "is_completed": true - }, - { - "created_at": "2024-05-24T20:39:01.665256Z", - "updated_at": "2024-05-24T20:39:01.665256Z", - "user_id": 3, - "course_id": 1, - "external_id": "883", - "type": "assignment_submission", - "is_completed": true - }, - { - "created_at": "2024-05-24T20:39:01.666065Z", - "updated_at": "2024-05-24T20:39:01.666065Z", - "user_id": 3, - "course_id": 1, - "external_id": "892", - "type": "assignment_submission", - "is_completed": false - }, - { - "created_at": "2024-05-24T20:39:01.666639Z", - "updated_at": "2024-05-24T20:39:01.666639Z", - "user_id": 3, - "course_id": 1, - "external_id": "903", - "type": "assignment_submission", - "is_completed": false - }, - { - "created_at": "2024-05-24T20:39:01.667177Z", - "updated_at": "2024-05-24T20:39:01.667177Z", - "user_id": 3, - "course_id": 1, - "external_id": "912", - "type": "assignment_submission", - "is_completed": false - }, - { - "updated_at": "2024-05-24T20:39:01.667624Z", - "user_id": 3, - "course_id": 1, - "external_id": "920", - "type": "assignment_submission", - "is_completed": false - } -] diff --git a/backend/tests/test_data/provider_platforms.json b/backend/tests/test_data/provider_platforms.json deleted file mode 100644 index e88250a9..00000000 --- a/backend/tests/test_data/provider_platforms.json +++ /dev/null @@ -1,86 +0,0 @@ -[ - { - "type": "canvas_oss", - "name": "CanvasLMS", - "account_id": "1", - "base_url": "https://staging.canvas.unlockedlabs.xyz", - "state": "enabled" - }, - { - "type": "canvas_oss", - "name": "Claude Anderson", - "account_id": "917041156", - "base_url": "https://www.purdy.info/dolorum-ipsa-accusantium-qui-odit-illum-ratione", - "state": "disabled" - }, - { - "type": "canvas_oss", - "name": "Prof. Rodrick Will", - "account_id": "436116420", - "base_url": "https://kunde.com/dolor-repudiandae-tempora-voluptatem-ea-dolorum-unde-illo-sunt.html", - "state": "enabled" - }, - { - "type": "canvas_cloud", - "name": "Brayan Carter", - "account_id": "818359091", - "base_url": "http://www.jenkins.com/impedit-quasi-esse-eum-temporibus-autem.html", - "state": "enabled" - }, - { - "type": "canvas_cloud", - "name": "Miss Iva Feil Sr.", - "account_id": "116903505", - "base_url": "http://anderson.com/quia-id-libero-iure-nisi", - "state": "archived" - }, - { - "type": "canvas_cloud", - "name": "Daphne Goyette V", - "account_id": "81151374", - "base_url": "http://thiel.com/quasi-quia-pariatur-non.html", - "state": "archived" - }, - { - "type": "canvas_cloud", - "name": "Adell Pacocha", - "account_id": "131201652", - "base_url": "http://goodwin.com/facere-dolorem-eum-impedit-voluptatem-eaque-et.html", - "state": "disabled" - }, - { - "type": "canvas_cloud", - "name": "Rosa Carroll", - "account_id": "605317581", - "base_url": "http://www.mills.net/quis-asperiores-corporis-similique-ab-similique-sapiente-ipsum", - "state": "disabled" - }, - { - "type": "canvas_cloud", - "name": "Itzel Williamson", - "account_id": "823415670", - "base_url": "http://www.leffler.info/distinctio-cum-quibusdam-optio-ea-dicta-itaque", - "state": "disabled" - }, - { - "type": "canvas_cloud", - "name": "King Denesik I", - "account_id": "425270111", - "base_url": "https://dibbert.com/voluptas-consequatur-placeat-amet-odio-omnis-itaque.html", - "state": "enabled" - }, - { - "type": "canvas_cloud", - "name": "Cullen Kuphal", - "account_id": "265829857", - "base_url": "http://www.bode.com/sapiente-ullam-velit-numquam-sunt", - "state": "enabled" - }, - { - "type": "canvas_cloud", - "name": "Alessandra Kirlin", - "account_id": "104070083", - "base_url": "http://www.kuvalis.com/voluptatem-et-illum-maiores-sint-sequi", - "state": "enabled" - } -] diff --git a/backend/tests/test_data/users.json b/backend/tests/test_data/users.json deleted file mode 100644 index 7edc88b3..00000000 --- a/backend/tests/test_data/users.json +++ /dev/null @@ -1,101 +0,0 @@ -[ - { - "name_first": "Dr. Opal Murphy DDS", - "name_last": "Agnes Bailey", - "email": "cedrick.donnelly@example.org", - "role": "student", - "created_at": "2024-04-09T18:55:27.000000Z", - "updated_at": "2024-04-09T18:55:27.000000Z", - "username": "RichardSchoen13", - "password_reset": true, - "facility_id": 1 - }, - { - "name_first": "Cindy Murphy I", - "name_last": "Ahmed Parker", - "email": "trycia.jenkins@example.com", - "role": "student", - "created_at": "2024-04-09T18:55:33.000000Z", - "updated_at": "2024-04-09T22:17:17.000000Z", - "username": "MeaganDouglas13", - "password_reset": false, - "facility_id": 3 - }, - { - "name_first": "Mr. Garett Willms", - "name_last": "Aracely McLaughlin", - "email": "katrina98@example.org", - "role": "student", - "created_at": "2024-04-09T18:55:48.000000Z", - "updated_at": "2024-04-09T21:57:50.000000Z", - "username": "ClaraFrami10", - "password_reset": false, - "facility_id": 4 - }, - { - "name_first": "Rebeka Gleichner", - "name_last": "Ardith Becker", - "email": "ygulgowski@example.net", - "role": "student", - "created_at": "2024-04-09T18:55:45.000000Z", - "updated_at": "2024-04-09T18:55:45.000000Z", - "username": "OpheliaNienow13", - "password_reset": false, - "facility_id": 1 - }, - { - "name_first": "Miss Loyce Borer", - "name_last": "Arely King", - "email": "gustave59@example.org", - "role": "student", - "created_at": "2024-04-09T18:55:27.000000Z", - "updated_at": "2024-04-09T18:55:27.000000Z", - "username": "OrvalKoelpin12", - "password_reset": false, - "facility_id": 1 - }, - { - "name_first": "Keaton Waters", - "name_last": "Ashleigh Kunde Jr.", - "email": "smorar@example.com", - "role": "student", - "created_at": "2024-04-09T18:55:27.000000Z", - "updated_at": "2024-04-09T18:55:27.000000Z", - "username": "LavadaLittel12", - "password_reset": true, - "facility_id": 4 - }, - { - "name_first": "Eliseo Reichert", - "name_last": "Earline Ruecker", - "email": "rbarton@example.net", - "role": "student", - "created_at": "2024-04-09T18:55:42.000000Z", - "updated_at": "2024-04-09T18:55:42.000000Z", - "username": "JulietFriesen13", - "password_reset": false, - "facility_id": 5 - }, - { - "name_first": "Santino Kautzer", - "name_last": "Elwyn Kreiger Jr.", - "email": "alexandre.bergstrom@example.org", - "role": "student", - "created_at": "2024-04-09T18:55:28.000000Z", - "updated_at": "2024-04-09T18:55:28.000000Z", - "username": "HeidiVonRueden14", - "password_reset": true, - "facility_id": 3 - }, - { - "name_first": "Raina Upton", - "name_last": "Euna Halvorson", - "email": "grimes.olin@example.org", - "role": "student", - "created_at": "2024-04-09T18:55:40.000000Z", - "updated_at": "2024-04-09T18:55:40.000000Z", - "username": "AshleeGaylord13", - "password_reset": false, - "facility_id": 2 - } -]