Repository navigation
test(agents): integration specs for the Configuration tab [21/21] - #342
gusfcarvalho merged 4 commits into
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (4)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughAdds four Vitest suites for agent configuration plugin access, tabs, inline editing, and pending-change review and save behavior. ChangesAgent configuration tests
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Other Merge Risk: ⚪ Minimal · up to The added configuration tests introduce no identified product behavior change or merge-blocking issue. Merge after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. A rabbit checks each plugin gate, Comment |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Several claimed save, conflict, masked-value, and keyboard flows remain incompletely tested.
Review effort: Balanced
Findings: 4
Open (4)
What changed in this PR
Adds full-tab integration coverage for agent remote configuration workflows without changing production code.
Changes:
- Tests inline editing, field permissions, and masked-value safeguards.
- Tests pending changes, review/save, conflicts, plugin tabs, and add-plugin gating.
- Verifies accessibility and keyboard behavior.
| File | Description |
|---|---|
AddPluginGating.spec.ts |
Tests instance-based plugin installation gating. |
InlineEditing.spec.ts |
Tests inline editors and field access states. |
PendingChanges.spec.ts |
Tests draft review, saving, and conflicts. |
PluginTabs.spec.ts |
Tests plugin tab behavior and accessibility. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| it('config keys: per-key editor with Remove, and never pre-fills a masked value (R25)', async () => { | ||
| const { wrapper, ws } = await mountTab(); | ||
| const editor = await openEditor(wrapper, '/plugins/local-ssh/config/port'); |
| it('Review & save previews, then saves ONE revision with If-Match and the comment', async () => { | ||
| const saved = { ...configRev7, revision: 8, overlay: { verbosity: 2 } }; | ||
| api.current.putConfig = vi | ||
| .fn() | ||
| .mockResolvedValue({ revision: saved, created: true }); |
| expect(wrapper.find('[data-test="pending-bar"]').exists()).toBe(false); | ||
| }); | ||
|
|
||
| it('409: shows the conflict and keeps the changes on "Keep my changes"', async () => { |
| await tab(wrapper, 'ubuntu-packages').trigger('keydown', { code: 'Home' }); | ||
| expect(document.activeElement).toBe(tab(wrapper, 'local-ssh').element); | ||
| await tab(wrapper, 'local-ssh').trigger('keydown', { code: 'Enter' }); | ||
| expect(selectedTabs(wrapper)).toEqual(['plugin-tab-local-ssh']); |
1a9ae35 to
f630a5c
Compare
f630a5c to
36874f8
Compare
36874f8 to
6e7d0df
Compare
6e7d0df to
1c1b7f8
Compare
1c1b7f8 to
d5b1242
Compare
d5b1242 to
7f87365
Compare
7f87365 to
4ae4c8d
Compare
gusfcarvalho
left a comment
There was a problem hiding this comment.
ccf-review: would APPROVE
Submitted as COMMENT: GitHub does not let a PR's author request changes on or approve it.
1 Nit.
Stack (gh stack 343): #322 → #323 → #324 → #325 → #326 → #327 → #328 → #329 → #330 → #331 → #332 → #333 → #334 → #335 → #336 → #337 → #338 → #339 → #340 → #341 → #342
Outside the diff
- [Nit]
src/views/admin/AgentsView.vue:568Before permissions hydrate, admins land on the Configuration tab and are then moved to Details: isAdmin is false until permissionsReady, and can() is optimistic, so on a cold load of /admin/agents defaultTab() returns 'config'. If the agent list resolves before /me/permissions, AgentConfigTab mounts and starts its loads (ensurePermissions waits for hydration, then fires GET config, instances and instance detail). The permissionsReady watch then moves the admin to Details and unmounts the tab. The requests still in flight are not cancelled. (1f18dbff7e7a)
Fixed later in the stack
- Plugin lookups by name read inherited properties in
src/components/agents/config/PluginSummaryCard.vue: fixed in #338 - Add plugin can silently replace a plugin the saved overlay already defines in
src/components/agents/config/PluginTabs.vue: fixed in #339 - CORE-TEST-002 in
src/components/agents/config/__tests__/InlineEditing.spec.ts: fixed in #342 - CORE-ERR-001 in
src/components/agents/config/editor/SavePreviewPanel.vue: fixed in #334 - UI-COMP-001 in
src/components/agents/config/editor/KeyValueEditor.vue: fixed in #333 - 422 errors for instances not in the preview are never shown, but still disable Save in
src/components/agents/config/editor/SavePreviewPanel.vue: fixed in #334 - policy_data arrays lack the "differs across instances" warning the policies editor has in
src/components/agents/config/effective/PolicyDataNode.vue: fixed in #337 - Removals are computed against whichever instance files happen to be loaded in
src/composables/agent-config/useOverlayDraft.ts: fixed in #331 - CORE-DUP-001 in
src/utils/agent-config/__tests__/fixtures/agentconfig-conformance.json: fixed in #325 - Follow the API's bounded instance list (companion of api#476) in
src/composables/agent-config/useAgentConfigApi.ts: fixed in #330 - The sync summary now counts stale instances as in sync in
src/utils/agent-config/instance-status.ts: fixed in #327
Layer 21 of 21 in the stacked split of #318. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nces "a reader gets no pencils and no plugin actions" only asserted absences, so it passed when the tab failed to load (CORE-TEST-002). It now first expects the schedule field and the local-ssh card. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"keeps the shield on the new plugin's tab" lists an extra instance (ip-all) the fixture API had no detail for. Its load failed silently before; now Add plugin waits for every reporting instance's file, so the spec serves ip-all's detail too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AddPluginGating and InlineEditing build their fleets with pagedListInstances, so meta (page fields, counts) matches the rows as the paginated API's would. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4ae4c8d to
224c22a
Compare

Part 21 of 21 of the stacked split of #318 (agent remote configuration). Every layer adds the final version of its files from #318, and only imports from layers below it, so each layer passes
make reviewableon its own. Nothing is reachable in the app until layer 20 wires the Configuration tab in.What
Integration specs that mount the full Configuration tab: inline editing, pending changes and review-and-save, plugin tabs, and add-plugin gating.
Tests
This layer is tests only.
Size exception
This PR is over the 1k-line limit (about 1,290 lines, all tests) and carries the
size-exceptionlabel. These four specs mount the wholeAgentConfigTabto test flows that cross components (edit inline → pending changes bar → review-and-save → save; adding a plugin against instance capabilities). They can't move below layer 20 because the tab doesn't exist until then, and moving them into layer 20 would push that layer to about 2.2k lines. Splitting them across more test-only PRs would add review rounds without making any one of them easier to read. No production code changes here.🤖 Generated with Claude Code
Summary by CodeRabbit