fix(targets): close all remaining multi-target droid edge cases

This commit is contained in:
Tam Nhu Tran committed 2026-02-17 03:22:45 +07:00
1 parent 3191a4ab38
commit 0431adf306
21 files changed
+1257 -265

No files matched your search

+20
View File
@@ -147,6 +147,26 @@ describe('parseUsageEntry', () => {
const result = parseUsageEntry(VALID_ASSISTANT_ENTRY, '/custom/project/path');
expect(result!.projectPath).toBe('/custom/project/path');
});
test('parses string target when present', () => {
const withTarget = JSON.stringify({
...JSON.parse(VALID_ASSISTANT_ENTRY),
target: 'droid',
});
const result = parseUsageEntry(withTarget, '/test');
expect(result).not.toBeNull();
expect(result!.target).toBe('droid');
});
test('ignores non-string target values', () => {
const withNumericTarget = JSON.stringify({
...JSON.parse(VALID_ASSISTANT_ENTRY),
target: 123,
});
const result = parseUsageEntry(withNumericTarget, '/test');
expect(result).not.toBeNull();
expect(result!.target).toBeUndefined();
});
});
// ============================================================================