Page MenuHomePhabricator

[Microtask] Add tests for VideoCutTool's backend and frontend
Open, Needs TriagePublic

Description

IMPORTANT: Don't assign yourself this task, but feel free to link to the task using the Gerrit Bug: marker

Currently there are no tests for VideoCutTool, as a small task, chose one component (in the frontend or backend) of the tool, and write a few tests for it.

Prerequisites

NOTE: We use create-react-app to bootstrap our frontend, ffmpeg for the image manipulation, and mongoose as the database ORM

Deliverables

  • Setup VideoCutTool using instructions in the README.md
  • Pick a component of the tool and write a few tests validating some functionality of the tool (ex: a test to make sure when a user is logged out, the sidebar stops displaying their name)
  • Run npm run test inside the docker container and verify that your test runs without any errors
  • Create a patch on Gerrit for VideoCutTool and upload your changes.
  • Make sure your commit message aligns with the Wikimedia commit message guidelines
  • Add @Gopavasanth and @Soda to your patch on Gerrit as reviewers.

Communication

If you have any questions, feel free to reach out on Zulip :)

Event Timeline

Hi, I would like to work on this issue. Could you please assign this to me?

Hi, I would like to work on this issue. Could you please assign this to me?

Hey @Sidharthkumar23 this is somewhat of a umbrella task of sorts so I'm not assigning it to a specific contributor, but feel free to work on it :)

Change 887006 had a related patch set uploaded (by Sohom Datta; author: Punith.nyk):

[labs/tools/VideoCutTool@master] Add tests for VideoCutTool

https://gerrit.wikimedia.org/r/887006

@ShreyashPingle Let me know if your are interested in working on this task wrt to testing the Mongoose model, I can try and take a stab at helping you integrate it with CI.

hey! I want to know that, Is this issue still open?

Change 890776 had a related patch set uploaded (by Najni Fatima; author: Najni Fatima):

[labs/tools/VideoCutTool@master] Added UT for src/components/home.jsx

https://gerrit.wikimedia.org/r/890776

Change 890776 merged by jenkins-bot:

[labs/tools/VideoCutTool@master] Added unit tests for src/components/home.jsx

https://gerrit.wikimedia.org/r/890776

Soda added a subscriber: deepchauhan18.

Removing assignee, pls read the top info text (this is umbrella microtask so please don't assign yourself the task but feel free to work on it)

Change 893426 had a related patch set uploaded (by Deepchauhan18; author: Deepchauhan18):

[labs/tools/VideoCutTool@master] tests: Add unit test for src/components/Notification.jsx

https://gerrit.wikimedia.org/r/893426

Change 887006 merged by jenkins-bot:

[labs/tools/VideoCutTool@master] Add tests for VideoCutTool

https://gerrit.wikimedia.org/r/887006

Change 894149 had a related patch set uploaded (by Deepchauhan18; author: Deepchauhan18):

[labs/tools/VideoCutTool@master] Merge branch 'master' of https://gerrit.wikimedia.org/r/labs/tools/VideoCutTool into T328928/notification-test

https://gerrit.wikimedia.org/r/894149

Change 894149 abandoned by Deepchauhan18:

[labs/tools/VideoCutTool@master] Merge branch 'master' of https://gerrit.wikimedia.org/r/labs/tools/VideoCutTool into T328928/notification-test

Reason:

Created wrong commit by mistake

https://gerrit.wikimedia.org/r/894149

Change 893426 abandoned by Deepchauhan18:

[labs/tools/VideoCutTool@master] tests: Add unit test for src/components/Notification.jsx

Reason:

Created this commit by mistake

https://gerrit.wikimedia.org/r/893426

Change 893426 restored by Deepchauhan18:

[labs/tools/VideoCutTool@master] tests: Add unit test for src/components/Notification.jsx

https://gerrit.wikimedia.org/r/893426

Change 893426 merged by jenkins-bot:

[labs/tools/VideoCutTool@master] tests: Add unit test for src/components/Notification.jsx

https://gerrit.wikimedia.org/r/893426

Change 900352 had a related patch set uploaded (by AFZL210; author: AFZL210):

[labs/tools/VideoCutTool@master] Test: added test for UrlBox component

https://gerrit.wikimedia.org/r/900352

Change 910843 had a related patch set uploaded (by Reputation22; author: Reputation22):

[labs/tools/VideoCutTool@master] Add tests for Header component

https://gerrit.wikimedia.org/r/910843

Change #900352 abandoned by Hashar:

[labs/tools/VideoCutTool@master] Test: added test for UrlBox component

Reason:

This repository has been migrated to GitLab: https://gitlab.wikimedia.org/cloudvps-repos/videocuttool/VideoCutTool

https://gerrit.wikimedia.org/r/900352

Change #910843 abandoned by Hashar:

[labs/tools/VideoCutTool@master] Add tests for Header component

Reason:

This repository has been migrated to GitLab: https://gitlab.wikimedia.org/cloudvps-repos/videocuttool/VideoCutTool

https://gerrit.wikimedia.org/r/910843

Hi! I'm Usama Walayat, a GSoC 2026 applicant for the Wikifile-Transfer project. I'd like to claim this task. After reviewing the VideoCutTool repositories on Gerrit (labs/tools/VideoCutTool frontend and labs/tools/video-cut-tool-back-end), here is my detailed test plan:
My Proposed Solution:

Backend (Python/pytest): Write unit tests for: video trimming parameter validation (invalid fromTime/toTime values), file MIME type detection logic (covering the known .mp4 vs video/webm mismatch bug T333403), OAuth token validation middleware, MediaWiki API error handling (network failures, invalid file titles), and the file upload endpoint
Frontend (JavaScript/Jest + React Testing Library): Write tests for: the video URL input and fetch flow, the trim/crop/rotate controls rendering correctly, the preview and reset button interactions (covering the known regression T400452), and the upload confirmation dialog
Set up a jest.config.js with proper coverage thresholds and integrate both test suites into the existing CI configuration
Target a minimum of 70% code coverage as a measurable starting benchmark, documented in the PR

I have experience writing pytest suites for Flask backends and Jest/RTL tests for React frontends. May I claim this task?