From 64e3716edef1b0d01bf5e413ad32c7af320abd1f Mon Sep 17 00:00:00 2001 From: William Valentin Date: Mon, 9 Feb 2026 21:56:27 -0800 Subject: [PATCH] test(tui): add /pair command parsing tests --- src/frontends/tui/commands.test.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/frontends/tui/commands.test.ts b/src/frontends/tui/commands.test.ts index 2914116..9f7c1f8 100644 --- a/src/frontends/tui/commands.test.ts +++ b/src/frontends/tui/commands.test.ts @@ -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' }); + }); +});