From 4ffa3588172b819e6be23f676f41492ab2d1144c Mon Sep 17 00:00:00 2001 From: TenzDelek <122612557+TenzDelek@users.noreply.github.com> Date: Wed, 5 Nov 2025 15:32:59 +0530 Subject: [PATCH 01/17] remove unwanted test (#126) --- .../reset-password/ResetPassword.test.tsx | 6 +-- .../routes/create-plan/CreatePlan.test.tsx | 43 ------------------- .../routes/dashboard/Dashboard.test.tsx | 9 ---- 3 files changed, 1 insertion(+), 57 deletions(-) diff --git a/src/components/auth/reset-password/ResetPassword.test.tsx b/src/components/auth/reset-password/ResetPassword.test.tsx index d43b0e0..7e19ea4 100644 --- a/src/components/auth/reset-password/ResetPassword.test.tsx +++ b/src/components/auth/reset-password/ResetPassword.test.tsx @@ -153,11 +153,7 @@ describe("ResetPassword Component", () => { { password: "4c2417eef23ec7fb1bd8d74eb29afe5f0867a4ddbdb707ada89d1cf91f0e6e1d", - }, - { - headers: { - Authorization: "Bearer test-token", - }, + token: "test-token", }, ); }); diff --git a/src/components/routes/create-plan/CreatePlan.test.tsx b/src/components/routes/create-plan/CreatePlan.test.tsx index dd674d7..4c80313 100644 --- a/src/components/routes/create-plan/CreatePlan.test.tsx +++ b/src/components/routes/create-plan/CreatePlan.test.tsx @@ -376,47 +376,4 @@ describe("CreatePlan Component", () => { fireEvent.click(confirmButton); expect(mockBlocker.proceed).toHaveBeenCalled(); }); - - it("updates an existing plan successfully", async () => { - const mockPlanData = { - id: "any-plan-123", - title: "Existing Plan", - description: "Description", - total_days: 10, - difficulty_level: "intermediate", - image_url: "", - tags: [], - language: "en", - }; - const mockUseParams = vi.fn().mockReturnValue({ plan_id: "any-plan-123" }); - vi.mocked(useParams).mockImplementation(mockUseParams); - vi.spyOn(axiosInstance, "get").mockResolvedValue({ - data: mockPlanData, - }); - vi.spyOn(axiosInstance, "put").mockResolvedValue({ - data: { ...mockPlanData, title: "Updated Plan" }, - }); - renderWithProviders(); - await waitFor(() => { - const titleInput = screen.getByPlaceholderText( - "studio.plan.form.placeholder.title", - ) as HTMLInputElement; - expect(titleInput.value).toBe("Existing Plan"); - }); - const titleInput = screen.getByPlaceholderText( - "studio.plan.form.placeholder.title", - ); - fireEvent.change(titleInput, { target: { value: "Updated Plan" } }); - const submitButton = screen.getByText("studio.plan.update_button"); - fireEvent.click(submitButton); - await waitFor(() => { - expect(axiosInstance.put).toHaveBeenCalledWith( - expect.stringContaining("/api/v1/cms/plans/any-plan-123"), - expect.objectContaining({ - title: "Updated Plan", - }), - expect.any(Object), - ); - }); - }); }); diff --git a/src/components/routes/dashboard/Dashboard.test.tsx b/src/components/routes/dashboard/Dashboard.test.tsx index 4f131cf..e5a4677 100644 --- a/src/components/routes/dashboard/Dashboard.test.tsx +++ b/src/components/routes/dashboard/Dashboard.test.tsx @@ -93,15 +93,6 @@ describe("Dashboard Component", () => { expect(coverImageHeader.tagName).toBe("TH"); }); - it("renders pagination navigation", () => { - renderWithProviders(); - - const paginationNav = screen.getByRole("navigation", { - name: "pagination", - }); - expect(paginationNav).toBeDefined(); - }); - it("fetches plans correctly and returns the correct data", async () => { vi.spyOn(axiosInstance, "get").mockResolvedValue({ data: { plans: [], total: 0 }, From 1a10313949dadcb4e15b84f5070be32ba56f7446 Mon Sep 17 00:00:00 2001 From: TenzDelek <122612557+TenzDelek@users.noreply.github.com> Date: Thu, 6 Nov 2025 09:55:55 +0530 Subject: [PATCH 02/17] longurl support (#127) --- .../molecules/content-sub/ContentComponents.tsx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/components/ui/molecules/content-sub/ContentComponents.tsx b/src/components/ui/molecules/content-sub/ContentComponents.tsx index 042aa94..cc37ca6 100644 --- a/src/components/ui/molecules/content-sub/ContentComponents.tsx +++ b/src/components/ui/molecules/content-sub/ContentComponents.tsx @@ -29,25 +29,14 @@ export const ContentIcon = ({ type }: { type: ContentType }) => { export const VideoContent = ({ content }: { content: string }) => { const regularVideoId = getYouTubeVideoId(content); const shortsVideoId = getYouTubeShortsId(content); - - if (regularVideoId && !shortsVideoId) { - return ( -
-

- Please upload only YouTube short -

-
- ); - } - - const videoId = shortsVideoId; + const videoId = regularVideoId || shortsVideoId; if (!videoId) return null; return (