mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-15 02:16:27 +00:00
fix(targets): close all remaining multi-target droid edge cases
This commit is contained in:
1 parent
3191a4ab38
commit
0431adf306
21 files changed
+1257
-265
No files matched your search
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
// ============================================================================
|
||||
|
||||
Reference in new issue
Block a user