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.
43 lines
1.3 KiB
TypeScript
43 lines
1.3 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 mias');
|
|
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 mias');
|
|
expect(msg).toContain('/t todas');
|
|
// Formatos de fecha
|
|
expect(msg).toContain('27-09-04');
|
|
// Configurar etiquetas en español
|
|
expect(msg).toContain('diario|l-v|semanal|off');
|
|
});
|
|
});
|