test(setup): update DictationDemo asset-missing contract to #294 (fixes CI on main) - #302
Conversation
The test asserted the component renders nothing when demo clips 404 — the exact behavior #294 deliberately removed (it blanked the wizard's Try-dictation act on every real install). New contract under test: the script cards are asset-gated and disappear; the hotkey card (shortcut + press-to-verify, zero assets needed) stays. This was the single failure breaking CI on main since #294 merged (34 files / 196 tests green with the fix). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughTest update for ChangesDictationDemo Test Update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
| Filename | Overview |
|---|---|
| frontend/src/test/DictationDemo.test.jsx | Updated the asset-missing test case to assert the hotkey card stays visible while only .dictation-demo__scripts is hidden on HEAD 404 — accurately mirrors the #294 component change (showScripts = assetsAvailable !== false gate). |
Sequence Diagram
sequenceDiagram
participant Test as DictationDemo.test.jsx
participant Comp as DictationDemo (mount)
participant Fetch as global.fetch (mocked)
Test->>Comp: "render(withI18n(<DictationDemo />))"
Note over Comp: assetsAvailable = null → showScripts = true<br/>Both .dictation-demo and .dictation-demo__scripts rendered
Comp->>Fetch: HEAD /demo_audio/dictation/en_conversational.wav
Fetch-->>Comp: "{ ok: false, status: 404 }"
Note over Comp: setAssetsAvailable(false) → showScripts = false<br/>.dictation-demo__scripts removed from DOM
Test->>Comp: waitFor → .dictation-demo__scripts is null ✓
Test->>Comp: .dictation-demo is not null ✓
Test->>Comp: queryByText(/Schedule a meeting with Pat/) absent ✓
Reviews (1): Last reviewed commit: "test(setup): update DictationDemo asset-..." | Re-trigger Greptile
CI on main has been red since #294:
DictationDemo.test.jsxasserted the component renders empty when demo clips 404 — the exact behavior #294 deliberately changed (blank Try-dictation act → always-on hotkey card). Test now asserts the new contract: script cards asset-gated, hotkey card stays. Full suite: 34 files / 196 tests green.🤖 Generated with Claude Code
Summary by CodeRabbit