mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
- Replaced raw pixel value in `css/tailwind.source.css` with theme-based `calc()` to fix token lint error. - Updated `tests/e2e/ui-modals.spec.ts` to skip close control check for `lockdown-modal`, aligning with inescapable design. - Added `KNOWN_ISSUES.md` documenting unresolved visual regression in sidebar layout and moderation UI rendering issues in tests. - Reverted incomplete attempt to fix sidebar CSS logic to maintain stability.
3.6 KiB
3.6 KiB
Known Issues
Tests
Unit Tests
npm run test:unitconsistently times out in the CI environment due to resource constraints. Targeted testing (test:dm:unit,test:dm:integration) is recommended.
Visual Regression Tests (test:visual)
- Moderation UI (
tests/visual/moderation.spec.ts): The "Show anyway" button and related moderation badges fail to render in the test environment, causingtoBeVisible()assertions to fail. The logic for creating the button appears correct (allowOverrideis true), but the button element is not found in the DOM during the test execution. This might be due to a race condition in the test fixture's state initialization or an environment-specific rendering issue. - Sidebar Layout (
tests/visual/overlay-layers.spec.ts): Themobile sidebar shares desktop rail behaviortest fails. The expected margin for the app container does not match the computed margin in the test environment (diff of ~45px). Attempts to fix this by adjusting CSS margin calculations were incomplete and reverted to avoid instability. - Kitchen Sink (
tests/visual/kitchen-sink.spec.ts): Minor pixel mismatch (width 1292 vs expected 1280) in snapshot comparison.
E2E Tests (test:e2e)
- Modals (
tests/e2e/ui-modals.spec.ts):application-formandprofile-modalfail with 404 errors for requested resources (likely related to howhttp-serverserves relative paths or nested components in the test runner).- Several modals (
upload-modal,edit-video-modal, etc.) timeout waiting for close actions or visibility checks. This might be due to thereducedMotionapplication interacting poorly with visibility checks or genuine performance issues in the test runner. login-modalfails to find the[data-nsec-error]element (it expects it to be visible but it remains hidden).
- Popover (
tests/e2e/popover.spec.ts): Fails withReferenceError: getPanelWithTriggerMetrics is not defined. This helper function seems to be missing or not imported correctly in the test file.
CSS / Design System
- The global CSS (
css/tailwind.source.css) was updated to fix a linter error by usingcalc(theme("screens.md") - var(--breakpoint-edge-offset))instead of raw pixels.
Retrospective & Future Improvements
Challenges
- Generated Artifacts: The build process modifies
css/tailwind.generated.css, which creates noise in diffs and potential merge conflicts. It is recommended to ignore this file in version control or enforce a check that it matches the build output without committing it manually in every PR. - Test Environment Isolation: Debugging visual test failures (like the Sidebar Layout and Moderation UI) was difficult without access to the live browser UI or artifacts. The reproduction script failed due to environment restrictions on launching browsers.
- Test Flakiness: E2E tests for modals are prone to timeouts, likely due to animation/transition handling or resource loading delays in the CI environment. Using
applyReducedMotionconsistently helps but doesn't solve all timing issues.
Suggestions
- Commit Hooks: Implement a pre-commit hook that runs the linter and potentially the build to ensure generated files are in sync, or configure CI to fail if they are not.
- Dockerized Testing: Running tests in a consistent Docker container with Xvfb properly configured would help reproduce environment-specific failures locally.
- Visual Testing improvements: Ensure that test fixtures (like
moderation/fixtures/index.html) correctly force UI updates after state injection to avoid race conditions.