Skip to content

test: Set up automated integration tests for useVideoEditor core controller #1334 - #1760

Merged
magic-peach merged 1 commit into
reframe-oss:mainfrom
Tarulatapriya:feature/test-suite
Sep 15, 2026
Merged

magic-peach merged 1 commit into
reframe-oss:mainfrom
Tarulatapriya:feature/test-suite

Conversation

@Tarulatapriya

Copy link
Copy Markdown
Contributor

Description

This PR addresses issue #1334 by implementing a robust integration test suite for the primary core controller of the app: useVideoEditor.ts.

While the Vitest framework was previously configured, useVideoEditor lacked test coverage despite containing the majority of the application's business logic, state transitions, and validation layers.

Fixes Made:

  • src/hooks/tests/useVideoEditor.test.ts: Implemented a comprehensive test suite using @testing-library/react (renderHook, act).
  • Environment Mocking: Implemented safe, isolated stubs for localStorage, URL.createObjectURL, sessionDB, and FFmpeg workers to ensure tests run reliably without invoking actual IndexedDB or WASM binaries.
  • Coverage:
    • Verified initial state integrity (DEFAULT_RECIPE).
    • Verified valid state transitions (updateRecipe).
    • Verified the strict validation/sanitization layer actively blocks malformed patches (e.g., speed: 9999).
    • Verified resetSettings functionality.

Related Issues

Closes #1334

Type of Change

  • Testing (Setting up automated unit/integration tests)

Additional Notes

  • Contributing under GSSoC 2026.

@github-actions github-actions Bot added level:intermediate Intermediate level - 35 pts type:bug Bug fix labels Aug 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ PR Format Check Passed — @Tarulatapriya

Basic format checks passed. A maintainer will review your code changes.

This does not mean the PR is approved — it just means the format is correct.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @Tarulatapriya!

Welcome to Reframe — a browser-based video editor built for everyone 🎬

🟠 GSSoC'26 PR detected — thanks for contributing under GirlScript Summer of Code 2026!

What happens next

  1. 🤖 Automated checks — build & TypeScript typecheck will run automatically
  2. Vercel preview — a preview deployment will be created (requires maintainer authorization for fork PRs)
  3. 👀 Code review — a maintainer will review your changes
  4. 🚀 Merge — once approved, your PR will be merged!

Quick checklist

  • PR title follows Conventional Commits (e.g. feat: add dark mode)
  • Linked the issue this PR closes (e.g. Closes #123)
  • Tested the changes locally (bun run dev)
  • Build passes (bun run build)

Useful links

Happy coding! 🎉

@github-actions github-actions Bot added the gssoc'26 GirlScript Summer of Code 2026 label Aug 30, 2026
@Tarulatapriya

Copy link
Copy Markdown
Contributor Author

Hey maintainers! 👋

I've submitted a PR to complete the automated unit and integration test suite (Issue #1334) under GSSoC '26.

Since Vitest was already configured, I focused on adding test coverage for the most critical "core controller" in the application: useVideoEditor.ts.

Here is a summary of the test suite I added:

Isolated Testing Environment: I set up robust mocks for localStorage, URL.createObjectURL, and the FFmpeg workers. This ensures the tests run instantly in a Node environment without attempting to download massive WASM binaries or throwing DOM errors.
Core Logic Coverage: The tests verify the initial state (DEFAULT_RECIPE), validate that proper updates merge correctly, and ensure the state is wiped clean when resetSettings is called.
Security/Validation Testing: I added a specific test to prove that the validation layer actively blocks invalid/malicious data (like speed: 9999) from poisoning the editor state.
This provides a very solid foundation for the editor's core logic! Let me know if you need any adjustments or if this looks good to merge! 🚀

@magic-peach
magic-peach merged commit e4be1a4 into reframe-oss:main Sep 15, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc'26 GirlScript Summer of Code 2026 level:intermediate Intermediate level - 35 pts type:bug Bug fix type:performance Performance type:testing Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Set up automated unit and integration test suite for reframe core controllers

2 participants