test(tui): add /pair command parsing tests

This commit is contained in:
William Valentin
2026-02-09 21:56:27 -08:00
parent 3ea4f64d6b
commit 64e3716ede
+22
View File
@@ -108,3 +108,25 @@ describe('getHelpText', () => {
expect(help).toContain('/quit');
});
});
describe('/pair command', () => {
it('parses /pair as list', () => {
expect(parseCommand('/pair')).toEqual({ type: 'pair', action: 'list' });
});
it('parses /pair list', () => {
expect(parseCommand('/pair list')).toEqual({ type: 'pair', action: 'list' });
});
it('parses /pair generate without label', () => {
expect(parseCommand('/pair generate')).toEqual({ type: 'pair', action: 'generate', args: undefined });
});
it('parses /pair generate with label', () => {
expect(parseCommand('/pair generate for alice')).toEqual({ type: 'pair', action: 'generate', args: 'for alice' });
});
it('parses /pair revoke with channel and sender', () => {
expect(parseCommand('/pair revoke telegram 12345')).toEqual({ type: 'pair', action: 'revoke', args: 'telegram 12345' });
});
});