Skip to content

test(app): stabilize session composer dock e2e#539

Merged
Astro-Han merged 1 commit into
devfrom
codex/i529-session-composer-dock
May 11, 2026
Merged

test(app): stabilize session composer dock e2e#539
Astro-Han merged 1 commit into
devfrom
codex/i529-session-composer-dock

Conversation

@Astro-Han

@Astro-Han Astro-Han commented May 11, 2026

Copy link
Copy Markdown
Owner

Summary

Stabilizes the session composer dock E2E coverage for #529 by replacing brittle scroll gestures and invalid one-option question seeds with deterministic test setup.

Why

The remaining #529 session-composer-dock slice was not a reliable user-path test:

  • The dock height test tried to leave bottom-follow mode with a mouse wheel gesture that can be swallowed by nested scroll handling and leave the timeline at the bottom.
  • Two question-dock tests seeded a single option even though the current question schema rejects one-option questions.
  • The overflow keyboard test pressed End without focusing the question options, so it did not exercise the dock's keyboard path deterministically.

This PR keeps the product code unchanged and makes the existing E2E assertions match stable user paths.

Related Issue

Refs #529.

Human Review Status

Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.

Review Focus

  • The new seedSessionTurns() helper only creates deterministic scrollable history for this spec.
  • scrollTimelineAwayFromBottom() now explicitly marks an upward wheel intent before moving the timeline, so the test exercises user-scrolled dock resize behavior instead of relying on flaky pointer placement.
  • The question seeds now satisfy the current two-option minimum without changing the behavior under test.

Risk Notes

Low risk. This is E2E-only test stabilization with no product code, schema, dependency, or generated-file changes.

How To Verify

Red repro before fix: focused session-composer-dock run had 2 failures / 1 pass; failures were the dock-height scroll gesture and overflow question End-key path.
Focused E2E: 5 passed (session-composer-dock dock-height, latest question dock, overflow question dock, blocked prompt focus, multiline question text).
App typecheck: passed (bun run typecheck in packages/app).
Diff check: passed (git diff --check).

Screenshots or Recordings

Not applicable. E2E-only test stabilization, no visible product UI change.

Checklist

  • Human review status is stated above as pending, approved, or not required
  • I linked the related issue, or stated why there is no issue
  • This PR has type, primary area, and priority labels, or I requested maintainer labeling
  • I described the review focus and any meaningful risks
  • I listed the relevant verification steps and the key result for each
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope
  • I manually checked visible UI or copy changes when needed, with screenshots or recordings
  • I considered macOS and Windows impact for platform, packaging, updater, signing, paths, shell, or permissions changes
  • I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant
  • I reviewed the final diff for unrelated changes and suspicious dependency changes
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English

Summary by CodeRabbit

  • Tests
    • Improved end-to-end test utilities and coverage for scroll behavior and keyboard interactions in the composer dock to enhance regression detection.

Review Change Stack

@Astro-Han Astro-Han added flaky-test Non-deterministic test failure P3 Low priority app Application behavior and product flows task Narrow execution, audit, spike, migration, tracking, or upstream follow-up work labels May 11, 2026
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 74de4ecc-d68e-4feb-9571-2c8d48cd176b

📥 Commits

Reviewing files that changed from the base of the PR and between 6080683 and fec52be.

📒 Files selected for processing (1)
  • packages/app/e2e/session/session-composer-dock.spec.ts

📝 Walkthrough

Walkthrough

This PR adds new E2E test utilities to the session-composer-dock spec file: a seedSessionTurns helper for pre-populating sessions with timeline content and a scrollTimelineAwayFromBottom helper for testing timeline scroll behavior. The main scroll regression test is refactored to use these utilities, and question dock tests are updated with explicit focus calls and expanded test question datasets.

Changes

E2E Scroll-Dock Test Utilities and Regression Updates

Layer / File(s) Summary
Selector Imports
packages/app/e2e/session/session-composer-dock.spec.ts
Imports extended with scrollViewportSelector and sessionTurnListSelector to support new timeline-scrolling logic.
Session Turn Seeding
packages/app/e2e/session/session-composer-dock.spec.ts
Added seedSessionTurns(page, count) helper that seeds a session with multiple promptAsync messages marked noReply: true to populate timeline without assistant replies.
Timeline Scroll Helper
packages/app/e2e/session/session-composer-dock.spec.ts
Added scrollTimelineAwayFromBottom(page, distance) that dispatches synthetic wheel events and polls until viewport reaches the requested distance from bottom.
Scroll Regression Test
packages/app/e2e/session/session-composer-dock.spec.ts
Refactored "keeps latest turn visible when dock height changes" test to use seedSessionTurns and scrollTimelineAwayFromBottom, and removed explicit scrollTop comparison assertion.
Question Dock Test Updates
packages/app/e2e/session/session-composer-dock.spec.ts
Added explicit .focus() calls to first question option in overflow test; expanded question datasets in two tests to include multiple options ("Continue"/"Stop" and "OK"/"Cancel").

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Astro-Han/pawwork#286: New E2E helpers for session-turn seeding and timeline-scroll overlap with existing scroll-regression test utilities and additions.
  • Astro-Han/pawwork#354: Same spec file and scroll-dock regression testing targets updated in this PR.
  • Astro-Han/pawwork#375: Addresses related session composer scroll-dock behavior and dock-height/scrolling regression tests.

Suggested labels

test, e2e

Poem

🐰 Scroll and seed the timeline so tall,
Helpers poll and focus through it all,
Regression tests now dance with care,
Dock and viewport, questionsfare!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'test(app): stabilize session composer dock e2e' clearly and concisely summarizes the main change: stabilizing E2E tests for the session composer dock component using Conventional Commits format.
Description check ✅ Passed The PR description comprehensively follows the template with all major sections completed: Summary, Why, Related Issue, Human Review Status, Review Focus, Risk Notes, How To Verify, and a fully-checked Checklist. All required information is present and detailed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/i529-session-composer-dock

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces helper functions seedSessionTurns and scrollTimelineAwayFromBottom to the E2E test suite for the session composer dock. These helpers improve test reliability and readability by standardizing how session data is seeded and how scroll behavior is simulated. Additionally, the PR updates existing tests to use these helpers, adds explicit focus calls before keyboard interactions, and expands test data for question options. As there were no review comments provided, I have no feedback to offer.

@Astro-Han Astro-Han merged commit f941040 into dev May 11, 2026
23 checks passed
@Astro-Han Astro-Han deleted the codex/i529-session-composer-dock branch May 11, 2026 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows flaky-test Non-deterministic test failure P3 Low priority task Narrow execution, audit, spike, migration, tracking, or upstream follow-up work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant