Skip to content

PP-2572 - #1

Merged
sergak01 merged 13 commits into
mainfrom
pp-2572
Jan 14, 2026
Merged

PP-2572#1
sergak01 merged 13 commits into
mainfrom
pp-2572

Conversation

@sergak01

Copy link
Copy Markdown
Contributor

🧪 Comprehensive Testing Infrastructure & Bug Fixes

This PR introduces a complete testing framework for pp-dev along with critical bug fixes and CI/CD improvements.


🔧 Bug Fixes

  • fix(plugin): Move topbar scripts injection to head-prepend for earlier page lifecycle loading (a248f91)
    • Moves auth/info.js, main.js, and main.css from body to head-prepend
    • Ensures toolbar assets load before page content renders

🧪 Testing Infrastructure

Unit & Integration Tests (Vitest)

  • Add comprehensive unit tests for:
    • Config loading and validation
    • Formatting helpers (html, css, templateFunction)
    • Color helper utilities
    • URL helper functions
    • Plugin normalization
  • Add integration tests for middleware:
    • pp-redirect middleware
    • proxy-cache middleware
    • rewrite-response middleware

E2E Tests (Playwright)

  • Add toolbar E2E tests:
    • Visibility and positioning
    • Minimize/expand functionality
    • Popup interactions
    • Sync button behavior
  • Add config watcher tests:
    • Debounce behavior verification
    • Config reload functionality

Test Scripts

  • npm run test:unit - Run unit tests
  • npm run test:integration - Run integration tests
  • npm run test:e2e - Run E2E tests
  • npm run test:all - Run all tests
  • npm run test:unit:coverage - Run with coverage

🐳 Docker Testing Environment

  • Add Dockerfile and .dockerignore for containerized test execution
  • Add run-tests.sh script for running dev servers in Docker
  • Support for CommonJS, Next.js ESM, and Next.js CJS test projects

⚙️ CI/CD Improvements

  • ci: Restore push trigger for develop branch in CI workflow (7a3bb34)
    • Ensures CI runs on direct pushes, not just PRs
    • Prevents untested code from being released via beta workflow
  • ci: Add @semantic-release/npm plugin with npmPublish: false (ac02ca4)
    • Updates package.json version during release without npm publish

🧹 Maintenance

  • Update test project dependency paths to correct relative location
  • Add test dependencies: vitest, @vitest/coverage-v8, @playwright/test, yargs

📊 Changes Summary

Category Files Changed Lines Added Lines Removed
Tests 18 ~2,500+ 0
Config 6 ~250 ~20
Docker 3 ~170 0
Source 1 3 3
Total 34 +3,876 -619

📝 Commits (8)

Commit Type Description
a248f91 fix Move topbar scripts injection to head-prepend
ac02ca4 ci Add @semantic-release/npm plugin to release config
6765bc6 chore Add test dependencies and scripts
6ec40af test Add unit and integration test infrastructure
e5f21a7 test Add E2E test infrastructure with Playwright
b2b036c build Add Docker configuration for testing
9ef6928 chore Update test project dependency paths
7a3bb34 ci Restore push trigger for develop branch

✅ Checklist

  • Bug fix for topbar script injection timing
  • Unit tests added
  • Integration tests added
  • E2E tests added
  • Docker testing environment configured
  • CI workflow fixed for develop branch
  • No breaking changes

@sergak01 sergak01 self-assigned this Jan 14, 2026
@sergak01
sergak01 merged commit 8bd833f into main Jan 14, 2026
2 checks passed
@sergak01
sergak01 deleted the pp-2572 branch January 14, 2026 12:58
@sergak01
sergak01 restored the pp-2572 branch January 14, 2026 13:04
@sergak01 sergak01 mentioned this pull request Jan 14, 2026
@sergak01
sergak01 deleted the pp-2572 branch January 27, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant