mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 14:17:11 +00:00
feat(auth): add opt-in shared context groups across accounts
This commit is contained in:
1 parent
1dae52014b
commit
4fed74c64b
21 files changed
+787
-25
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import { describe, expect, it } from 'bun:test';
|
||||
import { parseArgs } from '../../src/auth/commands/types';
|
||||
|
||||
describe('auth command args parsing', () => {
|
||||
it('parses create with explicit shared context', () => {
|
||||
const parsed = parseArgs(['work', '--share-context']);
|
||||
|
||||
expect(parsed.profileName).toBe('work');
|
||||
expect(parsed.shareContext).toBe(true);
|
||||
expect(parsed.contextGroup).toBeUndefined();
|
||||
});
|
||||
|
||||
it('parses context group with separate value', () => {
|
||||
const parsed = parseArgs(['work', '--context-group', 'sprint-a']);
|
||||
|
||||
expect(parsed.profileName).toBe('work');
|
||||
expect(parsed.shareContext).toBe(false);
|
||||
expect(parsed.contextGroup).toBe('sprint-a');
|
||||
});
|
||||
|
||||
it('parses context group with equals form', () => {
|
||||
const parsed = parseArgs(['--context-group=sprint-a', 'work']);
|
||||
|
||||
expect(parsed.profileName).toBe('work');
|
||||
expect(parsed.contextGroup).toBe('sprint-a');
|
||||
});
|
||||
|
||||
it('flags missing context group value as empty string', () => {
|
||||
const parsed = parseArgs(['work', '--context-group']);
|
||||
|
||||
expect(parsed.profileName).toBe('work');
|
||||
expect(parsed.contextGroup).toBe('');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user