test(claude): cover the per-repo account branches to clear the 95% gate

Adds the missing-line coverage the epic's new code left uncovered: Account /
DetectedAccount value equality, the set/unset no-workspace error branches, the
login dialog's escape-to-close, and the settings controls' live-update /
no-workspace / duplicate-add / re-login paths.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-28 01:13:03 +02:00
co-authored by Claude Opus 4.8
parent 53b93f092b
commit da82b48f9b
4 changed files with 85 additions and 0 deletions
@@ -140,6 +140,16 @@ void main() {
expect(published.single.data, {'action': 'login', 'name': 'work', 'dir': '/home/u/.claude-work'});
});
test('set/unset with no workspace open error clearly', () async {
wire(cwd: null);
final set = await run(['set', 'work']);
expect(set.ok, isFalse);
expect(set.error?.message, contains('no workspace'));
final unset = await run(['unset']);
expect(unset.ok, isFalse);
expect(unset.error?.message, contains('no workspace'));
});
test('unknown action → userError listing the verbs', () async {
wire();
final r = await run(['frobnicate']);