test(tui): add /pair command parsing tests
This commit is contained in:
@@ -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' });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user