You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			45 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			TypeScript
		
	
| import { describe, it, expect } from 'bun:test';
 | |
| import { CommandService } from '../../../src/services/command';
 | |
| 
 | |
| describe('CommandService - /t ayuda y /t ayuda avanzada usando help centralizado', () => {
 | |
|   it('"/t ayuda" incluye quick help y CTA a ayuda avanzada', async () => {
 | |
|     const res = await CommandService.handle({
 | |
|       sender: '600000001',
 | |
|       groupId: '',
 | |
|       message: '/t ayuda',
 | |
|       mentions: [],
 | |
|     });
 | |
| 
 | |
|     expect(Array.isArray(res)).toBe(true);
 | |
|     expect(res.length).toBeGreaterThan(0);
 | |
|     const msg = res[0].message;
 | |
| 
 | |
|     expect(msg).toContain('/t ver mis');
 | |
|     expect(msg).toContain('/t web');
 | |
|     expect(msg).toContain('Ayuda avanzada');
 | |
|     expect(msg).toContain('/t ayuda avanzada');
 | |
|     // Configurar etiquetas en español
 | |
|     expect(msg).toContain('diario|l-v|semanal|off');
 | |
|   });
 | |
| 
 | |
|   it('"/t ayuda avanzada" incluye scopes de ver y formatos de fecha', async () => {
 | |
|     const res = await CommandService.handle({
 | |
|       sender: '600000001',
 | |
|       groupId: '',
 | |
|       message: '/t ayuda avanzada',
 | |
|       mentions: [],
 | |
|     });
 | |
| 
 | |
|     const msg = res[0].message;
 | |
|     // Scopes de ver
 | |
|     expect(msg).toContain('/t ver sin');
 | |
|     expect(msg).toContain('/t ver grupo');
 | |
|     expect(msg).toContain('/t ver todos');
 | |
|     // Formatos de fecha
 | |
|     expect(msg).toContain('YY-MM-DD');
 | |
|     expect(msg).toContain('20YY');
 | |
|     // Configurar etiquetas en español
 | |
|     expect(msg).toContain('diario|l-v|semanal|off');
 | |
|   });
 | |
| });
 |